Created
September 30, 2014 20:51
-
-
Save charliewilco/3d37ac291ef8a832d485 to your computer and use it in GitHub Desktop.
BEM example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="block"> | |
<div class="block--element"> | |
<h3>Headline Level 3</h3> | |
<div class="block--element_modifier"> | |
<p>Other stuff you might need to know</p> | |
</div> | |
</div> | |
<div class="block--element"> | |
<h3>Headline Level 3</h3> | |
<div class="block--element_modifier"> | |
<p>Other stuff you might need to know</p> | |
</div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.4) | |
// Compass (v1.0.1) | |
// ---- | |
$mango: mix(gold, tomato, 100%); | |
$radius: .25rem; | |
.block { | |
font-family: Avenir; | |
background: $mango; | |
padding: .5rem; | |
max-width: 25rem; | |
border-radius: $radius; | |
color: goldenrod; | |
h3 { | |
font-weight: 300; | |
text-transform: uppercase; | |
} | |
&--element { | |
background: lighten($mango, 25%); | |
border-radius: $radius; | |
padding: .5rem; | |
margin-bottom: 2rem; | |
&:last-of-type { margin-bottom: 0; } | |
&_modifier { | |
border-top: 3px solid tomato; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.block { | |
font-family: Avenir; | |
background: gold; | |
padding: .5rem; | |
max-width: 25rem; | |
border-radius: 0.25rem; | |
color: goldenrod; | |
} | |
.block h3 { | |
font-weight: 300; | |
text-transform: uppercase; | |
} | |
.block--element { | |
background: #ffeb80; | |
border-radius: 0.25rem; | |
padding: .5rem; | |
margin-bottom: 2rem; | |
} | |
.block--element:last-of-type { | |
margin-bottom: 0; | |
} | |
.block--element_modifier { | |
border-top: 3px solid tomato; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="block"> | |
<div class="block--element"> | |
<h3>Headline Level 3</h3> | |
<div class="block--element_modifier"> | |
<p>Other stuff you might need to know</p> | |
</div> | |
</div> | |
<div class="block--element"> | |
<h3>Headline Level 3</h3> | |
<div class="block--element_modifier"> | |
<p>Other stuff you might need to know</p> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment