Support for unscoped css?
Closed this issue · 2 comments
btakita commented
As of v3, is there any way to have unscoped css in the tags?
cognitom commented
@btakita I think there's no option to turn it off.
https://github.com/riot/compiler/blob/v3.0.0/src/core.js#L594
How about adding CSS file directly into HTML...?
btakita commented
Thank you, I ended up doing just that with a sass build; rolling my own build system with node/bash scripts & json files.
Sometimes it's nice to have elements act as state machines to the child elements, using css classes.
parent-component.tag
<parent-component id="parent" class="{state1: ctx.state1, state2: ctx.state2}">
<child-component ctx="{opts.ctx}"></child-component>
</parent-component>
child-component.tag
<child-component>
<section class="state1"></section>
<section class="state2"></section>
</child-component>
child-component.css
child-component {
display: block;
}
child-component section {
display: none;
}
parent-component.state1 child-component .state1 {
display: block;
}
parent-component.state2 child-component .state2 {
display: block;
}