From the course: Learning Next.js

Unlock the full course today

Join today to access over 22,800 courses taught by industry experts or purchase this course individually.

Styling Next.js with styled JSX

Styling Next.js with styled JSX

From the course: Learning Next.js

Start my 1-month free trial

Styling Next.js with styled JSX

- [Instructor] The next JS library includes a style JSX tag by default, in order to allow to write encapsulated and scoped CSS to style a component specifically. So we're going to use these default style JSX tags to include before the closing tag of every component to target this one specifically with some CSS rules. For example, in this home component we would allow to target every component with the color blue, but for this component only. It's not going to be global. So let's use the example that we've been using so far. So for now, we're using this color for the home component specifically. We have a color for the heading for every component. And also for the not found page, so when you write something that you know does not exists. We're using the same color setting across the application, which is applied in the globals.css. So we're using the same CSS rules, which is implemented in the globals.css. So maybe we would…

Contents