Prefixed CSS first
User guide
- Getting Started
Concepts
Configuring webhint
Connectors
Development flow integration
Formatters
Hints
- AMP HTML validator
- Avoid CSS limits
- Avoid HTTP redirects
- aXe accessibility check
- Babel configuration hint set
- Compatibility of CSS, HTML and JavaScript features
- Correct `Content-Type` header
- Correct manifest extension
- Correct viewport
- Disallowed HTTP headers
- External links disown opener
- Has web app manifest
- Highest document mode
- HTTP cache
- Manifest has name
- Minify JavaScript
- Modern DOCTYPE
- No `P3P` headers
- No broken links
- No byte-order mark
- No protocol-relative URLs
- No small error pages
- No vulnerable libraries
- Nu HTML test
- Optimal compression
- Optimize images
- Performance budget
- Prefixed CSS first
- Specify button type
- SSL server test
- TypeScript configuration hints set
- Unneeded HTTP headers
- Use `Strict-Transport-Security` header
- Use `X-Content-Type-Options` header
- Use Apple touch icon
- Use charset `utf-8`
- Use HTTPS
- Use subresource integrity
- Valid `Set-Cookie` header
- Valid `theme-color`
- Valid manifest
- webpack configuration hints set
Parsers
Server configurations
Telemetry
Troubleshoot
- Concepts
- Configuring webhint
- Connectors
- Development flow integration
- Formatters
- Hints
- Parsers
- Server configurations
- Telemetry
- Troubleshoot
Prefixed CSS first (css-prefix-order
)
Ensure vendor-prefixed versions of a CSS property are listed before the standardized, unprefixed version.
Why is this important?
When multiple versions of the same CSS property are specified, the last supported one will be used due to how browsers handle fallback values. This means the order matters when using both vendor-prefixed and unprefixed versions of the same property. Specifically, the unprefixed version must be listed last to ensure standardized behavior takes precedence.
What does the hint check?
This hint examines CSS files looking for blocks containing both prefixed and unprefixed CSS properties or values. The hint then verifies the last listed version of a particular property in a block is unprefixed.
Examples that trigger the hint
appearance: none; |
display: grid; |
Examples that pass the hint
-moz-appearance: none; |
display: -ms-grid; |
How to use this hint?
To use it you will have to install it via npm
:
npm install @hint/hint-css-prefix-order |
Note: You can make npm
install it as a devDependency
using the --save-dev
parameter, or to install it globally, you can use the -g
parameter. For
other options see
npm
's documentation.
And then activate it via the .hintrc
configuration file:
{ |