postcss-ie11-pseudo-class

PostCSS plugin adding support for the :ie11
pseudo-class targeting IE 11 only.
The :ie11
pseudo-class allows projects to add CSS rules targeting only this browser.
To use, prepend your CSS selector with :ie11
. The pseudo-class behaves as if it applied to a special element above :root
/html
.
Example input:
Example output:
_
It also works with multiple selectors:
Input:
Output:
_
Usage
Advanced usage
This plugin relies on a behavior of CSS that if browsers don't recognize a certain selector they drop the whole rule even if other selectors after the unrecognized one match. The default selector used, '_:-ms-fullscreen'
, is recognized only by IE 11. You can change it to a different one that is recognized by other browsers by passing a ieSelector
option, e.g.:
will match IE 10 and 11. Note, however, that IE 10 support is not official so bugs affecting only that browser (and not affecting IE 11) may not be fixed.
See PostCSS docs for examples for your environment.
Inspirations
The project & its code is inspired by postcss-fixie.