From the course: Building Modern Projects with React
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Converting CSS modules to styled-components
From the course: Building Modern Projects with React
Converting CSS modules to styled-components
- All right, we know the basic syntax for defining and using styled components, so now it's time to convert all of the styling in our app, specifically in our CSS modules over to styled components. Now, this is obviously a bit of a tedious task, so it might take a little while, but just bear with me here while I walk through converting each of our components to a styled component. So, the process for this is fairly straightforward. We're going to open up each of our CSS modules here, and for each of the stylings that we've defined, we're going to create a styled component for it and replace that inside the corresponding component. So we're going to start off with our to-do list here. We're going to start off with todolist.css, and this one is fairly simple since it only contains one styling here. So what we're going to do is simply copy and paste these two styles here, and then go into todolist and make sure our…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.