Closed karak closed 5 years ago
Fixed in the riot-compiler@3.5.3. Thanks for reporting it
Thank you. Simple :host
is OK, but complex selector is still wrong.
:host {
color: red;
}
.clicked {
font-weight: bold;
}
is compiled to:
:host { color: red; } x-hello .clicked, [data-is="x-hello"] .clicked{ font-weight: bold; }
I think riot-compiler v3 cannot accept both of light and shadow DOMs without any switch as long as it always transforms CSS, although that switching would be easy by using ::shadow
pseudo selector.
And riot@4 work is much preferred, even if only for the custom elements.
I can add an option to avoid the scoped behavior. I will check it asap
The new riot-compiler@3.6
has an option to avoid prefixing the css:
const compiler = require('riot-compiler')
compiler.compile(sourceCode, {
parserOptions: {
style: {
prefixCSS: false
}
}
}, filePath)
Style section doesn't work because it is just inserted under shadow-root like bellow:
Using
:host
rather than custom implementation would fix this.APPEND: This issue happened when passing compiled riot.tag, not RAW call of
define
. For I suppose those use cases would be standard. ...Then, the compiler should have some CSS switch to support shadow DOM.