Skip to content

Commit f03ab7e

Browse files
committed
passing through attribute and element selectors fixes animations
1 parent 4fc6f48 commit f03ab7e

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,6 @@ function localizeNode(node, context) {
133133
}
134134
break;
135135

136-
case "attribute":
137-
case "element":
138-
if(!context.global && !context.explicit) {
139-
context.hasImplicitGlobals = true;
140-
}
141-
break;
142-
143136
case "id":
144137
case "class":
145138
if(!context.global) {

test.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -330,30 +330,26 @@ var tests = [
330330
error: /@keyframes :global\(\.\.\.\) is not allowed in pure mode/
331331
},
332332
{
333-
should: 'throw on implicit global element',
333+
should: 'pass through global element',
334334
input: 'input {}',
335-
error: /'input' must be explicit flagged :global/
336-
},
337-
{
338-
should: 'throw on implicit global element (with multiple 1)',
339-
input: 'input, .foo {}',
340-
error: /'input, \.foo' must be explicit flagged :global/
335+
expected: 'input {}'
341336
},
342337
{
343-
should: 'throw on implicit global element (with multiple 2)',
344-
input: '.foo, input {}',
345-
error: /'\.foo, input' must be explicit flagged :global/
338+
should: 'localise class and pass through element',
339+
input: '.foo input {}',
340+
expected: ':local(.foo) input {}'
346341
},
347342
{
348-
should: 'throw on implicit global attribute',
343+
should: 'pass through attribute selector',
349344
input: '[type="radio"] {}',
350-
error: /'\[type="radio"\]' must be explicit flagged :global/
345+
expected: '[type="radio"] {}'
351346
},
352347
{
353-
should: 'throw on implicit global attribute in nested',
354-
input: ':not([type="radio"]) {}',
355-
error: /':not\(\[type="radio"\]\)' must be explicit flagged :global/
348+
should: 'localise class and pass through attribute',
349+
input: '.foo :not([type="radio"]) {}',
350+
expected: ':local(.foo) :not([type="radio"]) {}'
356351
}
352+
357353
];
358354

359355
function process (css, options) {

0 commit comments

Comments
 (0)