Over on the JS Celebration poundcast:
[Kend C. Dodds]: […] ask anyone who’s finished common, outdated CSS they usually’ll inform you that “I don’t know if it’s okay for me to alter this, so I’m gonna duplicate it.” And now we’ve obtained – at PayPal (this isn’t made up) we had 90% unused CSS on the mission I used to be utilizing, as a result of all people was afraid to the touch the outdated stuff. So we simply duplicated one thing new and known as it one thing else. And also you may simply say that we’re dangerous at CSS, however possibly CSS was dangerous at us, I don’t know… [laughter]
[Emma Bostain]: Properly, that’s why styled-components and CSS-in-JS was so pivotal; it was like “Oh, hey, we are able to truly encapsulate all of this logic contained in the part that it’s touching and don’t have to fret about bleeding code anymore.” It’s a lot simpler to delete issues, and add issues, and all of these issues.
[Kend C. Dodds]: Yeah, you’re exactly proper. That was the issue that these issues had been made to unravel.
Audio clip:
I’ve heard this precise story earlier than a number of occasions, often from massive firms. Plenty of builders, typical developer turnover… no person is aware of what CSS is definitely used and what isn’t as a result of that could be a very arduous drawback.
That’s one of many causes I typically like component-based-styling options (CSS-in-JS, in case you’re nasty). Not as a result of I like advanced tooling. Not as a result of I like JavaScript syntax higher than CSS. Due to the co-location of kinds and componentry. As a result of no person is afraid of the kinds anymore — they’re tightly coupled to what they’re styling. It’s not wanted on each mission, however in case you’re constructing with parts anyway (an awfully good option to architect front-ends that doesn’t require JavaScript), you may as nicely fashion this fashion.
For that reason, I’m excited that “scoped kinds” are making a little bit of a comeback in requirements discussions.
I keep in mind an historic concept (that possibly even shipped in browsers for a minute?) the place you’d simply chuck a <fashion scoped> block proper within the HTML and regardless of the mother or father was, the kinds had been scoped to that mother or father. That was so cool, I want we may have that once more.
But it surely looks like the newer stuff (right here’s Miriam’s authentic proposal) has some extra intelligent stuff that that primary idea doesn’t cowl — like with the ability to set a lower-boundary along with an upper-boundary, making it doable to scope “donut-shaped” kinds within the DOM (a Nicole Sullivan time period). No matter occurs, shadow DOM-free scoped kinds with zero tooling is large.
The put up “We had 90% unused CSS as a result of all people was afraid to the touch the outdated stuff” appeared first on CSS-Methods. You possibly can assist CSS-Methods by being an MVP Supporter.
Subscribe to MarketingSolution.
Receive web development discounts & web design tutorials.
Now! Lets GROW Together!