DEV Community

Discussion on: Senior front end dev here, ask me anything!

titungdup profile image

How do you manage CSS in large projects with multiple frontend developers working on the same project? Do you have rulesets or standards to follow? And do you make it maintainable and scalable?

kendalmintcode profile image
Rob Kendal {{☕}} Ask Me Anything

It depends on the project and how it’s structured and things like are you using approaches like css-in-js or utility css.

But, in general, for larger teams with large, complex projects, I think you want a few things in place:

  1. Agreement or consensus on how we’re tackling styling in the project
  2. Some sort of design system that defines how certain UI elements will be styled (usually as a result of 1.)
  3. Lots of clear documentation on how we write the styles, using what approach, and methodologies
  4. Use linting to highlight deviations away from agreed guidelines before committing the code
  5. Code reviews to make sure everyone’s happy with new code being submitted

In terms of scale ability, I think that’s where utility-driven css (e.g. Tailwind) is quite helpful. But really, keeping things as simple as possible means you don’t end up in a styles soup where you’re fighting specificity and the cascade