cellery 1.4.4 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cells.js +12 -6
- package/package.json +1 -1
package/lib/cells.js
CHANGED
|
@@ -100,13 +100,19 @@ class Style {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
addScope(parent) {
|
|
103
|
+
let inKeyframes = 0
|
|
103
104
|
walk(this.content, {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
enter(node) {
|
|
106
|
+
if (node.type === 'Atrule' && node.name === 'keyframes') inKeyframes++
|
|
107
|
+
if (node.type === 'Rule' && inKeyframes === 0) {
|
|
108
|
+
node.prelude.children.forEach((selector) => {
|
|
109
|
+
selector.children.prependData({ type: 'Combinator', name: ' ' })
|
|
110
|
+
selector.children.prependData({ type: 'IdSelector', name: parent })
|
|
111
|
+
})
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
leave(node) {
|
|
115
|
+
if (node.type === 'Atrule' && node.name === 'keyframes') inKeyframes--
|
|
110
116
|
}
|
|
111
117
|
})
|
|
112
118
|
}
|