postcss-decls-ref
A PostCSS plugin that extend declaration block from an existed rule with target selector (like sass
@extend
).
Example
Input
Output
refMod: 'clone'
1) when option
refMod: 'group'
2) when option
Features
-
Support
@media
condition. -
AtRule name can dynamic (default is
@ref
).
Installation
npm install postcss-decls-ref --save-dev
Usage
Work with Gulp
Example:
var gulp = ;var postcss = ;var ref = ; gulp;
Options
refMod
Decide the output css result. The value is
clone
orgroup
.
- Default:
'clone'
- Required:
false
dynamicAtRule
Dynamic the atRule name, remember not to rename the css existed one (like
@media
,@support
, etc).@
character is not needed. Recommend:@ref
,@apply
.
- Default:
'ref'
- Required:
false
Contributing
Issues and Pull requests are welcome.
$ git clone github.com/Jeff2Ma/postcss-decls-ref$ cd postcss-decls-ref$ npm i$ gulp # for dev $ gulp test # for test