Friday, 11 May 2018

What’s wrong with CSS-in-JS?

Brad Frost thinks it's:

  1. Lack of portability
  2. Context Switching
  3. Flushing best practices down the toilet

In the spirit of good-ol-fashioned blog-and-response, here's:

I'd like to point out that "CSS-in-JS" is an umbrella term, and that there are lots of takes on actual implementations of this. It's possible to like one approach and not another.

Me, my guess is we'll end up with a split down the middle as a best practice someday.

When we write styles, we will always make a choice. Is this a global style? Am I, on purpose, leaking this style across the entire site? Or, am I writing CSS that is specific to this component? CSS will be split in half between these two. Component-specific styles will be scoped and bundled with the component and used as needed.

Direct Link to ArticlePermalink

The post What’s wrong with CSS-in-JS? appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/2rpos1p
via IFTTT

No comments:

Post a Comment

Passkeys: What the Heck and Why?

These things called  passkeys  sure are making the rounds these days. They were a main attraction at  W3C TPAC 2022 , gained support in  Saf...