-
-
Notifications
You must be signed in to change notification settings - Fork 188
Conversation
Looking forward to this landing. |
So exciting! |
@@ -54,6 +54,9 @@ title: cssnext - Use tomorrow’s CSS syntax, today. | |||
<a href="/features/#custom-properties-var">custom properties & <code>var()</code></a> | |||
</li> | |||
<li class="r-Grid-cell r-minS--1of2"> | |||
<a href="/features/#custom-properties-set-apply">custom properties set & <code>@apply</code></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replicated from above, but probably better that's right.
7cdb0a2
to
5324e5c
Compare
Will this works with custom props referenced in the spec like this? :root {
--toolbar-theme: {
background-color: hsl(120, 70%, 95%);
border-radius: 4px;
border: 1px solid var(--theme-color late); /* IS THIS SUPPORTED */ ?
};
--toolbar-title-theme: {
color: green;
};
}
.toolbar {
@apply --toolbar-theme;
}
.toolbar > .title {
@apply --toolbar-title-theme;
} I guess it don't since apply transformation is applied after custom props. But maybe I am missing something. |
I added some tests to the plugin for this very use case, seems okay to me: https://github.com/pascalduez/postcss-apply/blob/master/test/integration.test.js#L136-L227 Custom properties (single) are correctly parsed and replaced inside the custom properties (set), provided the plugins are in this PR order. |
Looks good enough. Thanks for this feature. |
Released as 2.7.0. |
Hi,
I'm not 100% sure about the plugin order, since it's supposed to be really similar with the custom properties one, I placed it next.
So basically all other transformations will happen on the applied rules, instead of the stored rules. Maybe in case of huge sets usage it could have an impact?
I added tests locally to the plugin to ensure it doesn't interfere with the custom properties one.
Refs #203