DEV Community

loading...

Discussion on: Styling in Gatsby

Collapse
iwaniukooo11 profile image
Mateusz Iwaniuk

Gatsby works perfect with the styled components library styled-components.com/

Answering your question above: if you want to create a div with specified styles, you can create a Div component

const Div = styled.div'
background: blue;
'

Where instead of ' ' you use` ` but I can't apply this in the comment:/

And then you pass <Div>...</Div> instead of simple <div>...</div>

The other way is to use CSS modules gatsbyjs.org/docs/css-modules/

And you can also just style by className. Yes, that' so simple

I hope I could help 💥