3 ms·
The styles defined _in_ the web component do not though (none of the `flex` styles are there). If the component was any more complicated than a pair of `<slot
by svieira 7y ago
The styles defined _in_ the web component do not though (none of the `flex` styles are there). If the component was any more complicated than a pair of `<slot />` elements then the DOM structure would also completely change (and any ::part and ::theme targets would be gone too).
When JS is disabled you are left with a bunch of arbitrary tags in a structure that doesn't match the structure they have when JS is enabled.
That said, I don't think there's a good answer to this problem. Components-as-macros would run without JS, but then you have the LISP problem with composing macros (maybe this is a solved problem, but I haven't read Common Lisp's spec or used Racket in anger).
- nickthemagicman 7y agoI don't think you're accurate on this. They're a browser spec not an drop in library. I don't know why the makers of the browser engine would ship something like that.
- svieira 7y agoBecause the browser engine didn’t ship the component, I did (or you, or that guy Harry who doesn’t know what he’s talking about, take your pick). The component only provides its styles when the JS is run (you can look at the definition). There is no way to make a component that doesn’t require JS (HTML imports were one attempt, but they didn’t work out).