Skip to content

Commit c94ea39

Browse files
authored
Merge pull request #4 from avidyut1/keyframes-moz-webkit-fix
Not adding container to moz and webkit keyframes
2 parents 708e00b + d928067 commit c94ea39

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
const _ = require('lodash/fp');
22
const postCss = require('postcss');
33

4+
const keyFramesParent = ['keyframes', '-webkit-keyframes', '-moz-keyframes'];
5+
46
const postCssWrapperPlugin= postCss.plugin('postcss-wrapper-plugin', function(prefix) {
57
return function(css) {
68
css.walkRules(function(rule) {
7-
if (_.isEqual(_.get('parent.name', rule), 'keyframes'))
8-
return;
9+
let parentName = _.get('parent.name', rule);
10+
if (_.includes(parentName, keyFramesParent))
11+
return;
912

1013
const selector = rule.selector;
1114
rule.selector = _.pipe(_.split(','), _.map(_.pipe(_.trim, joinPrefix(prefix))),

0 commit comments

Comments
 (0)