DevS
DevS

Reputation: 1

React custom compnent css modules vs global css

I need to make a clarification here. I have used sass for styling. I went along only with editing custom.scss file. Say I create an enterprice level project,say E commerce site. Is it a best practise or a convenient way to add component wise scss modules for each component?. Say it is a huge site with so many components, is it good to have so many custom css or just use one css file? I am a bit confused here.

Upvotes: 0

Views: 153

Answers (1)

sm3sher
sm3sher

Reputation: 3350

It depends. If you have a large project, but you have components that you use often, it's worth styling them individually.

On the other hand, there is general styling, for example, the font or even the background. Here it is no question that this belongs in a general stylesheet.

Everything in between is always situation-dependent. I tend that if the component is well capsulated, style them individually.

Upvotes: 1

Related Questions