React Inline Styles and the Future of CSS

by Alex Lande, Front-end Engineer at Formidable

Formidable
1 min readFeb 29, 2016

Writing and maintaining CSS for large applications (and large teams) can be challenging. Teams often have trouble with brittle selectors, naming collisions, specificity, and pile-ups of dead code.

After seeing these issues first-hand on large projects, we built Radium: a JavaScript library for styling React applications with inline styles. In the context of a React application, inline styling elegantly solves many of the issues with large-scale CSS. It also gives you the benefits of a CSS preprocessor like Sass, with extra power for expressive styling.

In the screencast below, I compare the benefits of approaches like Radium to some upcoming and proposed additions to the CSS specification that will help make scalable CSS easy in the future, whether you’re using React or not. I’ll also cover:

  • CSS Modules
  • Shadow DOM
  • CSS Variables and Custom Media Queries
  • Native CSS Extends

Read the docs: http://stack.formidable.com/radium/

Find the code: https://github.com/FormidableLabs/radium

*This open source project was conceived and built at Formidable.

We Are a privately-held, bootstrapped firm based in Seattle, WA. Developing complete web apps, embedding experts in clients’ teams, leading technology-specific training — we tailor our offerings to our customers’ needs, be they startups or Fortune 500s. We’re pushing the bleeding edge of the modern web by advancing the open-source software we use, teaching and learning new technologies, and pursuing opportunities and growth.

--

--