No man, I just hate global variables ;-) But seriously, Shadow DOM is the answer to CSS in the same way that "structured programming" is the answer to assembly.
-
-
Can you expound a little, my friend? I struggle with this...
1 reply 0 retweets 1 like -
CSS w/o Shadow DOM puts all rules and all elements into the same namespace for rule resolution. This creates all sorts of problems; specificity breaks down at scale.
1 reply 0 retweets 5 likes -
Replying to @slightlylate @stefsull and
Shadow DOM is like a function: local stuff is local, which reduces burden on global namespace while making internal concerns easier to reason about.
1 reply 0 retweets 5 likes -
Yes, that I understand. It was your Assembly reference. ;) Regardless, I've helped architect a CSS framework for an Enterprise company using principles that have avoided the things that scare y'all about CSS.
1 reply 0 retweets 4 likes -
Replying to @stefsull @slightlylate and
But Shadow DOM works opposite of how a well-architected framework works. And it's not compatible in many ways.
2 replies 0 retweets 3 likes -
Replying to @stefsull @slightlylate and
It feels like making it all local takes the C out of CSS. In fact, in some ways it kinda reverses it. CSS is really okay. It's not an untamed beast, just a different, very powerful beast. Whatever. It is what it is. I just wish we could finish that spec about theming. ;)
1 reply 0 retweets 4 likes -
I think of it as returning CSS to what it's good at: styling small trees. By making components responsible for their own internal
state, reduce the "bleed through" that makes managing styles so painful.
Good progress being made on part/theme: https://www.chromestatus.com/feature/5763933658939392 …2 replies 0 retweets 2 likes -
Replying to @slightlylate @stefsull and
And is CSS really ok? There has been an explosion of tools whose primary value is that they turn off specificity and the cascade (Inc CSS-in-JS tools). Teaching the "C" is a nightmare. Folks rightly want fewer foot-guns.
4 replies 0 retweets 5 likes -
Replying to @slightlylate @stefsull and
Specificity and document order is a heuristic for resolution. It is meaningful and accurate at small scales, but nonsensical at scale. That’s why CSS Blocks introduces an explicit, per property resolution primitive. https://github.com/linkedin/css-blocks/blob/master/README.md#block-resolutions …
1 reply 0 retweets 3 likes
Yeah, I'm seeing many systems disable the heuristics by enforcing zero descendant selector constraints. Needs platform support.
-
-
Replying to @slightlylate @stefsull and
I'm not that draconian in css blocks because I think selector matching is generally going to be faster than the equivalent DOM mutations in JS, but the ones that are can optimize duplicate declarations better with Opticss.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.