Skip to content
Browse files

Fixes #2113: ensures custom-style rules that use @apply combined with…

… defining properties apply correctly.
  • Loading branch information...
1 parent 720f2c0 commit 69a4aa597b0d7be78fd89ab3c417615dec6ed3aa @sorvell sorvell committed
Showing with 11 additions and 4 deletions.
  1. +0 −4 src/lib/custom-style.html
  2. +11 −0 test/unit/custom-style.html
View
4 src/lib/custom-style.html
@@ -125,10 +125,6 @@
function(rule) {
var css = rule.cssText = rule.parsedCssText;
if (rule.propertyInfo && rule.propertyInfo.cssText) {
- // TODO(sorvell): factor better
- // remove property assignments so next function isn't confused
- css = css.replace(propertyUtils.rx.VAR_ASSIGN, '');
- // replace with reified properties, scenario is same as mixin
rule.cssText = propertyUtils.valueForProperties(css, props);
}
styleTransformer.documentRule(rule);
View
11 test/unit/custom-style.html
@@ -41,6 +41,12 @@
display: block;
}
+ :root {
+ --bag2: {
+ border: 12px solid beige;
+ };
+ }
+
:root {
@@ -59,6 +65,7 @@
--special: var(--primary);
--after: 11px solid orange;
+ @apply(--bag2);
}
x-foo {
@@ -242,6 +249,10 @@
assertComputed(e, '11px', null, '::after');
});
+ test('@apply in :root rule that also defines properties', function() {
+ assertComputed(document.body, '12px');
+ });
+
});

0 comments on commit 69a4aa5

Please sign in to comment.
Something went wrong with that request. Please try again.