Bike plugin
This PostCSS plugin based on the idea of posthtml-bike by Alex Khyrenko and implements transformation of custom At-rules to BEM-like rules
Install
npm install --save-dev postcss-bike
Usage
const readFileSync = ;const postcss = ;const bike = ; const css = ; ;
Example
Default
@ } @ @ } @}
Transformed to:
Options
component
type: String
default: {component: 'component'}
Allows to set custom name for component @rule
.
element
type: String
default: {element: 'elem'}
Allows to set custom name for element @rule
.
modifier
type: String
default: {modifier: 'mod'}
Allows to set custom name for modifier @rule
.
modifierRegExp
type: RegExp
default: {modifierRegExp: /(\w+)\[(\w+)\]/}
Allows to set custom regular expressions for modifier params. Where $1
is Modifier Name and $2
is Modifier Value. For
changing Modifier Value Separator, change default separator \[$2\]
, which goes before and after $2
(only this [ ]
symbols).