Thanks to the popularity of React, mixing markup and behavior – once thought unfathomable – is now almost commonplace. So why not invite styling along to the party? Adding inline styles to your markup is a breeze.
“Inline styling?!” I hear you say?
I know, I was skeptical too. But for all the progress CSS has made over the past almost 20 years, it’s still broken and annoying enough we’ve invented whole ecosystems of tooling to... well, make it less broken and annoying.
As it turns out, putting your CSS in your JavaScript components makes a pretty big chunk of that badness just disappear. And the stuff we use our favorite pre- and postprocessors for, like variables, math, and loops? You get that for free.
Moving to a truly componentized front end not only saved our CSS sanity, it got our team shipping more features with fewer bugs faster – we just had to let go of some old habits and prejudices first.
This talk is from ATXSass on 26 May 2016.