PostCSS plugin adds a namespace/prefix to attribute selector.
Why ?
Needs to escape from the third-party frameworks.
Install
$ npm install postcss-attribute-selector-prefix
Note: This project is compatible with node v6+
Usage
// Dependenciesvar fs = ;var postcss = ;var attrSelectorPrefix = ; // CSS to be processedvar css = fs; // Process cssvar output = css; console;
Example
/* input.css */
/* Output example */
Options
prefix
Type: string
Default: ``
Description: add prefix to attribute selector
filter
Type: Array
Default: []
Description: attribute selector to which we must add the prefix
Example: ['class', 'id']
/* input.css */
/* Output example */
ignore
Type: Array
Default: []
Description: ignored attribute selector
Example: ['type', 'alt']
/* input.css */
/* Output example */