
Ask HN: Inline Styles or CSS-In-JS with React - danlan
I&#x27;ve been writing using React for a little over three years now and I&#x27;m currently using a combination of JSS (cssinjs) and inline styles.<p>Recently my colleague has voiced a preference for using solely Inline Styles and it makes sense to follow a common pattern but I&#x27;m hesitant as I&#x27;ve found the lack of cascading and pseudo elements with inline styles to be difficult in the past.<p>I also find using CSS classes produces cleaner render functions but I&#x27;m not sure that&#x27;s a worthy argument either.<p>Would love to hear what the general consensus is here
======
acemarke
There's plenty of options, with no distinct winner. Use whatever your team
finds most maintainable.

See the "React Styling" section of my React/Redux links list for articles
explaining the differences between these various approaches and some of the
tradeoffs involved: [https://github.com/markerikson/react-redux-
links/blob/master...](https://github.com/markerikson/react-redux-
links/blob/master/react-styling.md)

------
maxharris
A better alternative to CSS classes is [https://www.styled-
components.com/](https://www.styled-components.com/)

I'm using this in a huge production app (I wish I could tell you what it is,
but I don't want to link my work to my HN comments.)

