Skip to content

Instantly share code, notes, and snippets.

@jewlofthelotus
Created October 30, 2013 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jewlofthelotus/7236618 to your computer and use it in GitHub Desktop.
Save jewlofthelotus/7236618 to your computer and use it in GitHub Desktop.
A WIP guide on how to setup styles for a new block in an OOCSS / BEM / SMACSSish modular architecture.
/* ==========================================================================
Block Title
========================================================================== */
/**
* Markdown Example (HAML)
*
* %div.block_modifiers
* %header.block--element_modifiers
* %a{:href => "#"} Some Link
*/
// If the block or any of it's elements can have modifiers, they
// should be initialized with a class attribute selector here.
[class*="block"] {}
[class*="block--element"] {}
// Non-modifiable elements, if any, should come next.
.block--element2 {}
.block--element3 {}
/* --------------------------------------------------------------------------
Block Modifiers
-------------------------------------------------------------------------- */
// Next define your modifiers using the exact class selector.
.block__modifer {}
.block__modifer2 {}
.block--element__modifer {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment