Naming things
Don't be lazy, be explicit, be thoughtful
You should find names (if there is not already) for your classes that are explicit and well thought. Once a name is used it is very hard to change it.
Some general rules
Please do this in collaboration with designers and other BU's, especially if you don't speak english with ease.
Think of the position of the elemnt in the ITCSS pyramid, and try to find a name that match its genericness (? I don't know the word). let me clarify : for an organism you have an element that is very hight level and have a clear purpose in your interface, maybe a feature.
You should have a very specific name for it.
In the other hand, a very generic element should not have a name that mirror usage, but a more functional, descriptive name about is nature.
For exemple, for the identification form of your app, you can call it .go-login-form
, but imagine an icon that represent a cog
, you should not call it .ga-icon--parameter
since it ties the usage of the cog icon with the parameters feature. Use instead .ga-icon--cog
For exemple, .cm-sidebar-menu
or .ca-alf-size-image
are not good names because they create a location or context dependency. We should create reusable, context agnostic components. If a pattern is semantically tied to another one, or to a position, it may signify that you only need one component.
Use only plain words to compose your classes names, this is also true for variables, mixins etc :
and not
You can use abbreviations in utility classes or some common Layouts, and for common sizes names. But you need to make sure that everybody is on the same page.
Exemple :
This would be a bit overkill. We will prefer :
It is a bit cryptic, but since those utilities should be used often and in a lot of places, peoples will learn quickly to read them.
Last updated