postcss-hocus

1.0.0 • Public • Published

Postcss-hocus PostCSS Logo

Postcss-hocus fixes a tiny but annoying part of CSS: That you have to repeat yourself whenever you want to specify both :hover and :focus. Instead, you can write a:hocus:

/* before */
a:hocus {
    color: red;
}
 
/* after */
a:hover,a:focus {
    color: red;
}

Additionally, you can write a:pocus so also include the :active style:

/* before */
a:pocus {
    color: red;
}
 
/* after */
a:hover,a:active,a:focus {
    color: red;
}

Usage

Add postcss-hocus using npm:

npm install postcss-hocus --save-dev

Then add in your PostCSS Config:

postcss([
    require('postcss-hocus')
]);

Package Sidebar

Install

npm i postcss-hocus

Weekly Downloads

2

Version

1.0.0

License

ISC

Last publish

Collaborators

  • kilianvalkhof