Styling TodoMVC Application
Styling Approach
Traditional pattern in organizing web pages was to split them up into markup (HTML), styling (CSS) and logic (JavaScript) files. With React, there has been a change in that mindset. The idea is to push styling to the component level. The best practices are still being figured out, but different patterns exist.
We will be using one of the available libraries called Radium.
What is Radium?
Radium is a set of tools to manage inline styles on React elements. It gives you powerful styling capabilities without CSS.
Radium unlocks the power of React & inline styling by enabling support for CSS pseudo selectors, media queries, vendor-prefixing, and much more through a simple interface.
Prerequisites
First, we will have to install some additional libraries to our project.
Let's make the following changes:
For styling to work, we'll need to annotate our classes using @Radium decorator, and for that we need decorators plugins.
Let's now install the new dependencies:
And commit the changes:
Last updated
Was this helpful?