React - Styling / CSS

There are multiple ways to create styles for your components. Each of the solutions require some bundling configuration and different approach to writing code

You can choose the most convenient way to add styles but should also know alternative solutions

Standard CSS

I can style components using simple css files imports or global styles.

I am fully aware this approach is not scalable and should be used only for a few global styles or POCs

I know that I can provide inline styles using styles props

CSS modules

I know how to use a CSS modules that create a unique classnames that do not conflict between different components.

I know how to setup my application / bundler to support both CSS and modules imports

CSS preprocessors

I know that I can create reusable CSS using preprocessors like SCSS (recommended) or SASS. I know how to setup my bundler to support additional preprocessor

Styled components

I know how to create styles using styled-componentsLibrary that creates classnames straight from styles in JS

Tailwind

I know how to use Tailwind'sLibrary with predefined sets of classes for various CSS properties

I know how advantages and disadvantages of this approach

CSS frameworks

I know some CSS frameworks like Bootstrap that provide predefines styles for some ui components

Icon of React
Icon of Styling / CSS
React skill
core
Styling / CSS
Ready to learn
Required technologies

I can style components using simple css files imports or global styles.

I am fully aware this approach is not scalable and should be used only for a few global styles or POCs

I know that I can provide inline styles using styles props

I know how to use a CSS modules that create a unique classnames that do not conflict between different components.

I know how to setup my application / bundler to support both CSS and modules imports

I know that I can create reusable CSS using preprocessors like SCSS (recommended) or SASS. I know how to setup my bundler to support additional preprocessor

I know how to create styles using styled-componentsLibrary that creates classnames straight from styles in JS

I know how to use Tailwind'sLibrary with predefined sets of classes for various CSS properties

I know how advantages and disadvantages of this approach

I know some CSS frameworks like Bootstrap that provide predefines styles for some ui components

Close
Loading content