DEV Community


Discussion on: Styling in Gatsby

iwaniukooo11 profile image
Mateusz Iwaniuk

Gatsby works perfect with the styled components library

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

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

I hope I could help 💥