BEM stands for "block, element, modifier" and is a front-end naming convention. Essentially, follows this scheme:
- Block = module (or 'parent' element in a particular construct)
- Element = sub-module (or a 'child' element in that construct)
- Modifier = a variation of a particular module / sub-module
Suggested BEM-like syntax and naming convention follows this scheme in that we will have blocks (or modules), block elements (or sub-modules), and block modifiers.
See: http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/
This is the pattern:
.block {}- represents the higher level of an abstraction or component..block__element {}- represents a descendent of .block that helps form .block as a whole..block--modifier {}- represents a different state or version of .block.
Double rather than single hypens and underscores are used to allow for blocks to be hyphen delimited. We do not want to use camelCaseClassNames.
###Example:
.author-account {} /* module or block */
.author-account__field {} /* sub-module or element */
.author-account--active {} /* modifier */