Haha. @slightlylate your happiness is now a product feature. For reals, more precompilation/CSS output from CSS-In-JS solns always welcome.
-
-
Replying to @addyosmani @kylemathews and
fwiw glamor uses insertRule, which iiuc avoids DOM parsing?
1 reply 0 retweets 0 likes -
Replying to @threepointone @addyosmani and
Unless I misunderstand, `insertRule()` takes a string which is then parsed. The CSS Typed OM is still a WIP: https://drafts.css-houdini.org/css-typed-om-1/
1 reply 0 retweets 0 likes -
Replying to @slightlylate @addyosmani and
Right, is that very different from the perf of <style>? insertRule() avoids adding text node to the dom (as opp to appending text to style)
2 replies 0 retweets 0 likes -
Replying to @threepointone @addyosmani and1 reply 0 retweets 0 likes
-
Replying to @slightlylate @addyosmani and
Thanks! so even a style tag/link tag would exec the parser, yes? (Been trying to figure this out for days, thanks for engaging)
1 reply 0 retweets 0 likes -
Replying to @threepointone @slightlylate and
Trying to figure out what exactly makes a style/link faster and/or js slower
1 reply 0 retweets 0 likes -
Replying to @threepointone @addyosmani and
So a couple of things here: if you leave your CSS in a <style> tag and don't have it as a JS string, you skip double-parsing
1 reply 0 retweets 0 likes -
Replying to @slightlylate @threepointone and
Next, `insertRule()` will do the exact same work as the CSS parser, so that's 1:1 for styles you'll use. Question will be "when?"
1 reply 0 retweets 0 likes -
Replying to @slightlylate @threepointone and
...but you'll have to reify wrapper objects for all of these rules (more memory) if you do it in JS.
1 reply 0 retweets 0 likes
And lastly, style resolution is delayed & batches. It's part of why querying `offsetLeft` can be expensive sometimes and cheap others.
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.