This repository was archived by the owner on Dec 22, 2023. It is now read-only.
Replies: 1 comment 2 replies
-
While it is feasible to provide CSSStyleSheet implementation I wouldn't recommend the approach used in Emotion, StyledComponents in production for two reasons:
Sciter has better (IMO) alternative to this problem by offering styleset's: class Component extend Element {
render() {
return <div styleset="theme.css#Component">
<button>Foo</foo>
</div>;
}
} and theme.css: @set Component {
:root { background:red; }
button { background:green; }
button:hover { background:gold; }
} So a) styles and code are separated and b) local component styles are not polluting common style space. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Current there is simply no way to dynamically inject styles via JS. Having CSSStyleSheet support would allow easy manipulation of CSS via JS. A further use case is CSS-in-JS (libraries like Emotion, StyledComponents) etc.
Beta Was this translation helpful? Give feedback.
All reactions