The style set is a collection of styles rules local (rooted at) to the component. :root denotes the component to which styleset is applied.
The style set definition is strictly local to the component - rules inside it do not pollute global style table. That is close to to anyone who remember such thing.
Here is how styled component.js module looks like:
const padding = "12px";
const styleset = CSS.set`
:root {
color: var(--theme-color);
padding:${padding};
background: var(--theme-back);
}
:root > em {
color: gold;
}`
export class TestComponent extends Element {
render() {
return
Hello Embedded Style Set
;
}
}
IMHO, that's the best of two worlds - components may have local styles principal for their operation, and to use global styles that define macro properties like themed colors, etc.