Design comparison
Solution retrospective
Hello, I'm new to react and I'm not sure how am I supposed to style my components, is it better to use multiple CSS files for each component or just a big one for the entire page. also is there any best practices I should know? any tips? or things I could do better? and thanks in advance.
Community feedback
- @tankop1Posted about 3 years ago
For styling in React, I personally suggest using different CSS files for every major component.
It is also good practice to use components wherever you can to reduce the amount of code. For example, in your Gallery.jsx file, you should make the gallery-image divs inside the Gallery component its own component so you minimize your code even further.
Great Job!
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord