How to name my custom properties semantically
Hello everyone, I would like some help and suggestions for articles that I can read about how I can name my custom properties in a better way.
Instead of just naming the colors like: --red, --blue, --cyan, etc.
I want to learn a better way of how I can name them, I heard that I should name the colors as primary, secondary (accent), neutral.
8 Replies
My custom properties look like this
do you use sass?
No
well, i don't see any issues with naming your colors what they are
https://atendesigngroup.com/articles/component-element-modifier-design-pattern <-- you can try to apply this, if you want
The Component, Element, Modifier Design Pattern | Aten Design Group
The Component, Element, Modifier pattern increases the reusability and maintainability of CSS code by scoping CSS styles to particular components through the use of class naming conventions.
but if you used sass, you could make a function that creates a variable and would make everything much simpler
Thanks brother