Skip to content

Instantly share code, notes, and snippets.

@illepic
Created August 29, 2014 23:11
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 illepic/efe45c9e9e2bdd0a124d to your computer and use it in GitHub Desktop.
Save illepic/efe45c9e9e2bdd0a124d to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
// Solution: change .button extendable to %button
%button {
background: green;
color: white;
padding: 20px;
font-size: 12px;
}
// Then just have a .button class @extend %button. This way html
// elements with .button still get expected styles
.button {
@extend %button;
}
// All instances of "@extend .button" need to be changed to "@extend %button"
.thingy1 {
@extend %button;
}
.thingy2 {
@extend %button;
font-size: 48px;
}
// So now styling against .button no longer blows everything up
.something .button {
font-weight: bold;
}
.another-thing .button {
padding: 10px;
}
.button, .thingy1, .thingy2 {
background: green;
color: white;
padding: 20px;
font-size: 12px;
}
.thingy2 {
font-size: 48px;
}
.something .button {
font-weight: bold;
}
.another-thing .button {
padding: 10px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment