Skip to content

Instantly share code, notes, and snippets.

@tow8ie
Created January 20, 2015 09:04
Show Gist options
  • Save tow8ie/a893040fc0413469d287 to your computer and use it in GitHub Desktop.
Save tow8ie/a893040fc0413469d287 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
#foo
.b-module
I’m a b-module
.a-module
.a-module__title
I’m a-module’s title
.a-module__close
I’m an encapsulated b-module inside an a-module
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
#foo {
background: #eee;
padding: 20px;
}
.a-module {
background: #ccc;
height: 200px;
padding: 10px;
position: relative;
&__title {
font-size: 30px;
font-weight: bold;
}
&__close {
@extend .b-module;
position: absolute;
top: 0px;
right: 0px;
}
}
.b-module {
background: green;
color: white;
padding: 10px;
width: 200px;
height: 50px;
}
#foo {
background: #eee;
padding: 20px;
}
.a-module {
background: #ccc;
height: 200px;
padding: 10px;
position: relative;
}
.a-module__title {
font-size: 30px;
font-weight: bold;
}
.a-module__close {
position: absolute;
top: 0px;
right: 0px;
}
.b-module, .a-module__close {
background: green;
color: white;
padding: 10px;
width: 200px;
height: 50px;
}
<div id='foo'>
<div class='b-module'>
I’m a b-module
</div>
<div class='a-module'>
<div class='a-module__title'>
I’m a-module’s title
</div>
<div class='a-module__close'>
I’m an encapsulated b-module inside an a-module
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment