Styling (CSS)
Last updated
Was this helpful?
Last updated
Was this helpful?
This boilerplate uses for styling React components. styled-components
allows you to write actual CSS inside your JavaScript, enabling you to use the 💪 without mapping between styles and components. There are many ways to style React applications, but many developers find styled-components
to be a more natural approach to styling components.
To complement styled-components
, this boilerplate also has a CSS linting setup. It uses stylelint
which will help you stay consistent with modern CSS standards. Read about it .
sanitize.css
This boilerplate also uses to make browsers render all elements more consistently and in line with modern standards, it's a modern alternative to CSS resets. More info available on the .
The example below creates two styled React components (<Title>
and <Wrapper>
) and renders them as children of the <Header>
component:
(The CSS rules are automatically vendor-prefixed, so you don't have to think about it!)
🧙Tips: Importing from styled-components/macro
will enable some features you can .
Type-safe media queries can be complicated if you haven't mastered TypeScript. Therefore we include a to make things easier for you.