Join the conversation

Sign in to join this conversation, and others like it, in the communities you care about.

styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress!

styled-components / Off Topic

That recent CSS-in-JS controversy though...

That recent CSS-in-JS controversy though...

styled-components / Off Topic · May 11, 2018 at 9:10am
I tend to feel like everybody's accepted CSS in JS, but then every now and then some big developer from the "old guard" finds it and opens up the whole controversy right from the start and so many developers pop out from under the grass and start complaining how dumb we all are 🙄
(also, welcome to the offtopic channel! /cc @phil @probablyup)

May 11, 2018 at 10:19am
😂
like-fill
1
  • reply
  • like

Looks to me like a classic Fuller Solution, though - the old guard are discussing hither and yon, and meanwhile, here we all are building the world of tomorrow.

  • reply
  • like

I don't know, I still think it mainly comes down to a use case mismatch

  • reply
  • like

I think most people who've built web apps with components at scale (i.e. with a >10 person team) quickly realize the benefits of CSS-in-JS

  • reply
  • like

But if most of your clients want a 10 page marketing static site it seems completely bonkers to put css in js

like-fill
1
  • reply
  • like

Well, obviously. Just like you probably shouldn't write your databases in assembly language, or the likes! ;)

  • reply
  • like

But the CSS needed for any static site is very unlikely to face the problems that any given webapp of non-trivial scale does.

  • reply
  • like

Yeah exactly

  • reply
  • like

I just wish some people wouldn't immediately jump to "omg these youngsters who don't know CSS of course they do this they're sooo lazy and ignorant just learn CSS"

  • reply
  • like

So condescending about a topic they don't even want to investigate properly

  • reply
  • like
🙄
  • reply
  • like

It is annoying, yeah. "Just learn CSS" like A) that's something you just _do_, and B) like CSS hasn't had to build up an array of practices and hacks to deal with complexity it, let's be honest, was never intended for.

  • reply
  • like

^How I feel about the whole brouhahah.

  • reply
  • like

Pretty much entirely addressed at the old-guarders.

  • reply
  • like

Yeah

  • reply
  • like

But also, I find the whole 'you do it in js cause you don't know css' a bit silly.

  • reply
  • like

For what I felt when I wrote it, the world was going towards the same concepts that make CSS-in-JS so powerful: encapsulation, dead code elimination etc.

  • reply
  • like

From the single CSS file 'god no I'm never gonna touch it again' to SMACSS from @snook

  • reply
  • like

to OOCSS, BEM, inverted triangle, atomic stuff and so on

  • reply
  • like

I mean...the almighty Brad Frost, very skeptical about the new thing to me is one of the main sources of inspiration behind CSS-in-JS

  • reply
  • like

Also, this is strictly personal, when I write a styled component I totally feel I'm writing CSS.

like-fill
1
  • reply
  • like

Hard same on that last one.

  • reply
  • like
Your message here...

*bold*_italic_`code````codeblock```