We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8a4958 commit 364ba2bCopy full SHA for 364ba2b
lib/hoistGlobalsAndWrapContext.js
@@ -0,0 +1,25 @@
1
+'use strict';
2
+
3
+module.exports = function(styles, selector) {
4
+ var global = {};
5
6
+ global[selector] = styles;
7
8
+ for (var key in styles) {
9
+ if (key[0] === '@') {
10
+ // At-rule.
11
+ if (key[1] === 'k') {
12
+ // @keyframes
13
+ global[key] = styles[key];
14
+ } else {
15
+ var obj = {};
16
+ obj[selector] = styles[key];
17
+ global[key] = obj;
18
+ }
19
20
+ delete styles[key];
21
22
23
24
+ return global;
25
+};
0 commit comments