postcss-icss-selectors
PostCSS plugin for css modules to local-scope classes and ids
Usage
See PostCSS docs for examples for your environment.
Options
mode
local
by default or global
In local mode
/* => */ /* => */ /* Shorthand global selector */ /* => */ /* => */ /* Targeted global selector */ ) /* => */ ) /* => */ ) /* => */ ) /* => */
In global mode
/* => */ /* => */ /* Shorthand local selector */ /* => */ /* => */ /* Targeted local selector */ ) /* => */ ) /* => */
generateScopeName(localName, filepath, css)
Converts every new local name in #id or .class defintion to global alias.
By default returns [name]__[local]---[hash:base64:5]
.
Messages
postcss-icss-selectors passes result.messages for each local-scoped class or id
{
plugin: 'postcss-icss-selectors',
type: 'icss-scoped',
name: string, // local-scoped identifier
value: string // generated global identifier
}
License
MIT © Mark Dalgleish and Bogdan Chadkin, 2015