postcss-hover-prefix

0.0.1 • Public • Published

A PostCSS plugin to prefix selectors that use :hover pseudoelements.

Useful to not letting hover effects on apps when browsing from a mobile device

Example input

.Component { /* ... */ }
.Component--modifier:hover { /* ... */ }
.Component-descendent { /* ... */ }

Example output classPrefix('pfx')

.Component { /* ... */ }
.pfx .Component--modifier { /* ... */ }
.Component-descendent { /* ... */ }

Usage

var fs        = require('fs');
var postcss   = require('postcss');
var hoverPrfx = require('postcss-hover-prefix');
 
var css = fs.readFileSync('css/my-file.css', 'utf8').toString();
var out = postcss()
          .use(hoverPrfx('.my-prefix'))
          .process(css);

License

MIT

Acknowledgements

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    209
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    209

Package Sidebar

Install

npm i postcss-hover-prefix

Weekly Downloads

209

Version

0.0.1

License

MIT

Last publish

Collaborators

  • mediasq