Closed oleersoy closed 8 years ago
I tried changing cssA.css to look like this:
/*
@import 'cssB.css';
*/
:root {
--varB: 'valueB';
}
:root {
--varA: var(--varB);
}
h1 {
color: var(--varA);
}
When I run process.js
I now get this as a result:
/*
@import 'cssB.css';
*/
h1 {
color: 'valueB';
}
So it works fine with multiple :root
selectors in the same file. It appears the core issue is that when css-simple-vars
is combined with postcss-import
the :root
block gets replaced...
Thoughts?
Ole
I did one more experiment. It looks like this:
@import 'cssB.css';
:root {
--varB: 'valueB';
}
:root {
--varA: var(--varB);
}
h1 {
color: var(--varA);
}
In this case the result is:
ole@MKI:~/Sandbox/test1$ node process.js
:root {
--varB: 'valueB';
}
h1 {
color: 'valueB';
}
So the @import
statement only replaces the first root selector...
Hi. It is not postcss-simple-vars
syntax. It looks like cssnext.
Ooops - Wrong repository - Thanks.
Hi,
I have a CSS file like this:
And in
cssB.css
:If I run this through the following script:
I get this as a result:
So the original
cssA.css :root
selector is completely replaced by the:root
selector fromcssB.css
. Is that supposed to happen? Since suitcss theme uses multiple:root
selectors in a single file, I assumed that this was OK?Cheers, Ole