i'm saying that it's easier for the browser to figure out how to paint an element if it only has to worry about a few local styles, rather than seeing which of the global ones are relevant and doing the specificity dance
-
-
Replying to @Rich_Harris @AdamRackis
I'm not sure I get the "SSR" concern. It's implicitly a question about the support for SD/polyfills in crawlers. Also: https://github.com/GoogleChrome/rendertron …
1 reply 0 retweets 0 likes -
Replying to @slightlylate @AdamRackis
If I have a page like this... <element-with-shadow-dom/> the no-JS version (which is also the SSR'd page, until your JS loads and inits) looks totally different from how it should, unless there's a declarative way of specifying the shadow DOM styles and content
1 reply 0 retweets 2 likes -
Replying to @Rich_Harris @AdamRackis
You can style it as a placeholder. And tools can emit the definitions inline if you like.
1 reply 0 retweets 0 likes -
But tools like Rendertron solve this for the crawler cases.
1 reply 0 retweets 0 likes -
Replying to @slightlylate @AdamRackis
You can't style it as a placeholder in the general case. Not unless you know exactly what is in the shadow DOM and how it will layout (taking account of fonts etc...). The best you can do is an approximation
2 replies 0 retweets 1 like -
Replying to @Rich_Harris @AdamRackis
Writing good components is always hard. Fallback/pre-upgrade styles are part of that
1 reply 0 retweets 0 likes -
Replying to @slightlylate @AdamRackis
The point is it's only hard with custom elements. With UI frameworks you get that *for free*. If declarative (i.e. SSR-friendly) shadow DOM were a thing, people would use it a lot more, but until then it's very hard to recommend it
1 reply 0 retweets 4 likes -
Replying to @Rich_Harris @AdamRackis
We've tried multiple times to introduce that. Have had pretty bad pushback from the JS-centric world (hate for imports and the <element> element).
1 reply 0 retweets 1 like -
Replying to @slightlylate @AdamRackis
I hate to say it, but I think these ideas would have gained a lot more traction if they hadn't been bundled with Polymer (which is the perception, rightly or wrongly). A way to import HTML fragments without going via JS? Sign me the hell up!
1 reply 0 retweets 1 like
People have been proposing HTML transclusions and components for something like 2 decades. You don't have to like Polymer to acknowledge that our coordinated effort to push things forward in a disciplined way got much, much further than anyone else has.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.