mozilla / protocol

A design system for Mozilla websites.
https://protocol.mozilla.org/
Mozilla Public License 2.0
259 stars 77 forks source link

Establish naming conventions #8

Closed craigcook closed 6 years ago

craigcook commented 6 years ago

We'll need to give individual components useful and meaningful names as we define them, but we also need to settle on a naming convention for classes and IDs in CSS.

And maybe we come up with something of our own scheme. Perhaps based on a combination of what we like from the above, or a modification of a syntax we mostly like just without the things we don't.

stephaniehobson commented 6 years ago

Also for consideration:

CSM (Components, Sub-components, Modifiers), which is the system Mobify uses. They use prefixes as well. I know they're not human readable but they are very useful for rules and organizing.

stephaniehobson commented 6 years ago

An argument for prefixes/namespacing: https://csswizardry.com/2015/03/more-transparent-ui-code-with-namespaces/

stephaniehobson commented 6 years ago

Sounds like we can combine the "inverted triangle" organization of ITCSS with any of the other systems as we wish. Beyond that it's "partially proprietary" which IMHO makes it easy to rule out.

craigcook commented 6 years ago

Sounds like we can combine the "inverted triangle" organization of ITCSS with any of the other systems as we wish. Beyond that it's "partially proprietary" which IMHO makes it easy to rule out.

Yup. From what very little I've been able to read about ITCSS it seems more like a methodology than an actual syntax. So we may end up being inspired by portions of it but it's not something we would adopt wholesale.

stephaniehobson commented 6 years ago

is- (for state) has- (for children) js- (for only JS purposes) (NO STYLING)

l- (layout) t- (theme) c- (component) u- (utility, global useage, many consequences)

qa- (for testing purposes) (NO STYLING)

stephaniehobson commented 6 years ago

We seem to have independently arrived at Brad Frost's prefix system: http://bradfrost.com/blog/post/css-architecture-for-design-systems/

craigcook commented 6 years ago

Documenting decisions...

I'll write this up more formally and document it in the system with some examples.