We were not trimming the token before checking for @ character so
only rules without whitespace were working fine.
var candidate = candidates[i];
var firstColonAt = candidate.indexOf(':');
- var atRule = candidate[0] == '@';
+ var atRule = candidate.trim()[0] == '@';
if (atRule) {
context.track(candidate);
list.push([AT_RULE, candidate.trim()]);
'multiple @apply with some styling': [
'a{@apply(--rule1);@apply(--rule2);color:red;display:block}',
'a{@apply(--rule1);@apply(--rule2);color:red;display:block}'
+ ],
+ 'multiple @apply with whitespace': [
+ 'a{' + lineBreak + '@apply(--rule1);' + lineBreak + ' @apply(--rule2);' + lineBreak + 'color:red;display:block}',
+ 'a{@apply(--rule1);@apply(--rule2);color:red;display:block}'
]
})
)
]
]
],
+ '@apply with whitespace': [
+ 'a{ @apply(--rule); }',
+ [
+ [
+ 'selector',
+ [['a']],
+ [['at-rule', '@apply(--rule)']]
+ ]
+ ]
+ ],
'media query': [
'@media (min-width:980px){}',
[