Skip to content

Instantly share code, notes, and snippets.

@Stanton
Created January 21, 2015 20:45
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 Stanton/06e5327bde07dfa8f18c to your computer and use it in GitHub Desktop.
Save Stanton/06e5327bde07dfa8f18c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<p class="foo">foo</p>
<p class="foo foo--bar">foo bar</p>
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
.foo {
// these won't be used as we're not inheriting them later
border-top-color: pink;
border-bottom-color: pink;
// these will be used through inheritance
border-left-color: red;
border-right-color: orange;
}
.foo--bar {
// set the border
&:before,
&:after {
border-width: 1px;
border-style: solid;
content: ' ';
display: inline-block;
height: 1em;
width: 10px;
}
/* check we can use :before/:after multiple times
* and use inherit to use the colours set in .foo
*/
&:before { border-left-color: inherit; }
&:after { border-right-color: inherit; }
}
.foo {
border-top-color: pink;
border-bottom-color: pink;
border-left-color: red;
border-right-color: orange;
}
.foo--bar {
/* check we can use :before/:after multiple times
* and use inherit to use the colours set in .foo
*/
}
.foo--bar:before, .foo--bar:after {
border-width: 1px;
border-style: solid;
content: ' ';
display: inline-block;
height: 1em;
width: 10px;
}
.foo--bar:before {
border-left-color: inherit;
}
.foo--bar:after {
border-right-color: inherit;
}
<p class="foo">foo</p>
<p class="foo foo--bar">foo bar</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment