Skip to content

Instantly share code, notes, and snippets.

@trodrigues
Last active January 4, 2016 05:49
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 trodrigues/8577343 to your computer and use it in GitHub Desktop.
Save trodrigues/8577343 to your computer and use it in GitHub Desktop.
Contextual higher level classes affecting content of extends in SASS
// In some cases we might want to have the following in SASS:
.some-class-name {
width: 50%;
}
.under-a-specific-context {
.some-class-name {
width: 35%;
}
}
// But let's say that you actually have an extendable only extends in SASS:
%some-extendable {
width: 50%;
}
.some-class-name {
@extend %some-extendable
}
// You could still do
.under-a-specific-context {
.some-class-name {
width: 35%;
}
}
// but that would only affect that specific use of %some-extendable
// what if you would want to affect all uses of %some-extendable?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment