postcss-wrapper-loader
Advanced tools
Comparing version 1.0.0 to 1.0.1
const _ = require('lodash/fp'); | ||
const postCss = require('postcss'); | ||
const keyFramesParent = ['keyframes', '-webkit-keyframes', '-moz-keyframes']; | ||
const postCssWrapperPlugin= postCss.plugin('postcss-wrapper-plugin', function(prefix) { | ||
return function(css) { | ||
css.walkRules(function(rule) { | ||
if (_.isEqual(_.get('parent.name', rule), 'keyframes')) | ||
return; | ||
let parentName = _.get('parent.name', rule); | ||
if (_.includes(parentName, keyFramesParent)) | ||
return; | ||
@@ -10,0 +13,0 @@ const selector = rule.selector; |
{ | ||
"name": "postcss-wrapper-loader", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "This plugin wraps all the cssClasses in a css file with a prefix class while webpack bundled. It helps to scope a specific css file with a prefix class", |
4037
44