From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

CSS stylesheets: Global CSS and importing CSS

CSS stylesheets: Global CSS and importing CSS

Welcome back, let's discuss CSS stylesheets. CSS stylesheets is a global way to define a global CSS in your React application. You can take it as conventional HTML and CSS based project CSS files, where you define your CSS stylesheets and all the common classes that you want to use throughout your project. You can define number of CSS style sheets and over there you can define different classes that you want to use alongside your project. These styles can be applied globally across all your components and this is a good usage when you want to use something like reset styles or typography and define a base layout and base css condition that should apply to your overall app. That's how a css stylesheet is being imported. You have to create a file name with an extension of .css and you can import it in the string parameters. You can import these CSS files directly into your components or whether you want to import it in the main file, the main.tsx or your app.tsx file. It's useful when…

Contents