4 ms·
> We’re entering a new chapter where simplicity is sophistication again, where global stylesheets coexist peacefully with scoped rules. does anyone know, scope
by throwaway290 10mo ago
> We’re entering a new chapter where simplicity is sophistication again, where global stylesheets coexist peacefully with scoped rules.
does anyone know, scoped style rules are here to stay or not? <style scoped> is deprecated and in HTML spec <style> is not allowed in body https://html.spec.whatwg.org/multipage/semantics.html#the-style-element https://html.spec.whatwg.org/multipage/semantics.html#the-st...
(This is how I suspect it's LLM slop, it's such an important thing and it just is skipped without mention)
- azangru 10mo ago> does anyone know, scoped style rules are here to stay or not? There is the @scope CSS directive. It is part of the CSS spec now. MDN even says it is supported by all latest browsers. > in HTML spec <style> is not allowed in body Parts of the body can be encapsulated in the shadow DOM; and the shadow DOM allows its own <style> tags.
- throwaway290 10mo agoThanks. That's a JS-only thing then right?
- azangru 10mo agoThe style tag inside of a shadow DOM? No, it can be written declaratively in plain html markup.
- throwaway290 10mo agoif you need JS to actually use shadow dom then this sort of scoped styling is JS only