DEV Community

Discussion on: CSS Custom Properties (vars) with SASS/SCSS, a practical architecture strategy

Collapse
ryzhov profile image
Aleksandr N. Ryzhov

Hi, you say about prefix to avoid conflict => "and in the case of CSS Custom Properties, also add a prefix to avoid conflicts", point me please where and how it can happen ?

Thanks for article, very useful,
Alex

Collapse
felipperegazio profile image
Felippe Regazio Author

There are some cases:

  1. If you have a very large codebase, you can use those prefixes as namespaces, to avoid name conflict on your own codebase.

  2. If you load a CSS Lib that uses a variable name with same name as yours, that also would be a problem.

  3. If your Styles will be used along a very large or distributed application, you dont know what kind of code already lives there, so better to use prefixes to keep everybody safe,

Collapse
ryzhov profile image
Aleksandr N. Ryzhov

It's clear now,
Thanks a lot