At Little Miss Robot we use our own custom version of
BEMIT
to name our classes & components.
Basically, it all boils down to a few simple rules:
Hierarchy
Components are prefixed to visualise in which category
they belong.
.a-atom
-
.a- for atoms
-
.m- for molecules
-
.o- for organisms
-
.u- for utilities
-
.l- for layouts
Modifiers
To create a an alternative version of a certain component,
we create a modifier.
Modifiers are visualized by seperating them with double dashes.
.m-molecule--modified
Sub-elements
A component can contain multiple sub-elements,
and their class-name needs to reflect their relationship to the parent component.
We do this by using double underscores.
.m-molecule__sub-element
States & javascript
The javascript in our purely for documentation purposes,
we'll provide helper classes that can be accessed through javascript or
add states that can be modified with javascript.
-
.is-open is an example of a state. We'll provide the styling that goes with the 'open' state of this component, but we won't provide the javascript to toggle this state.
-
.js-resize is an example of a javascript helper class. It shows which element can be manipulated through javascript.