Gatsby
Up and Running with Gatsby: Styling

Intro to CSS-in-JS

PRO

Let's learn about the popular concept CSS-in-JSS!

Let's talk about CSS-in-JS.

CSS-in-JS (sometimes called JSS, though I don't hear this often) lets us use JavaScript to declare CSS styles. This has a lot of cool benefits, like being scoped to components and allowing dynamic styling calculations.

At the moment, the two most popular libraries for CSS-in-JS in React are Emotion and styled-components. We're going to use styled-components in this tutorial and the rest of Up and Running with Gatsby.

Let's first install styled-components in the next video.