All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rules.scsslint.VendorPrefix.html Maven / Gradle / Ivy

Details

Avoid vendor prefixes. That is, don't write them yourself.

Instead, you can use Autoprefixer or mixins -- such as Compass or Bourbon -- to add vendor prefixes to your code. (If using your own mixins, make sure to exempt their source from this linter.)

At-rules, selectors, properties, and values are all checked. (See the examples below.)

The default identifier_list, base, should include everything that Autoprefixer addresses. You could also use a list covering Bourbon's CSS3 mixins: bourbon. If neither of those suit you, you can write your own identifier list.

Additionally, you can manually include or exclude identifiers from the identifier list -- if, for example, you want to use pretty much all of the base list but also want to allow yourself to use vendor prefixed transform properties, for one reason or another.

All identifiers used by the identifier_list, additional_identifiers, or excluded_identifiers are stripped of vendor prefixes. See the predefined lists for examples.

Bad: vendor prefixes

@-webkit-keyframes anim {
0% { opacity: 0; }
}

::-moz-placeholder {
color: red;
}

.foo {
-webkit-transition: none;
}

.bar {
position: -moz-sticky;
}

Good

// With Autoprefixer ...
@keyframes anim {
0% { opacity: 0; }
}

::placeholder {
color: red;
}

.foo {
transition: none;
}

.bar {
position: sticky;
}

// With Bourbon mixin
@include placeholder {
color: red;
}
Configuration Option Description
identifier_list Name of predefined identifier list to use (base or bourbon) or an array of identifiers (default base)
additional_identifiers Identifiers to lint, in addition to the identifier_list (default [])
excluded_identifiers Identifers in the identifier_list and additional_identifiers to exclude from linting (default [])




© 2015 - 2024 Weber Informatics LLC | Privacy Policy