Skip to content

Instantly share code, notes, and snippets.

View dmfrancisco's full-sized avatar

David Francisco dmfrancisco

View GitHub Profile
@dmfrancisco
dmfrancisco / bem.md
Last active January 25, 2023 20:25
TL;DR · Getting your head around BEM syntax

BEM – meaning block, element, modifier – is a front-end naming methodology. CSSWizardry uses a naming scheme based on BEM, but honed by Nicolas Gallagher. The naming convention follows this pattern:

.block {}
.block__element {}
.block--modifier {}
  • .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