Last active
January 4, 2016 05:49
-
-
Save trodrigues/8577343 to your computer and use it in GitHub Desktop.
Contextual higher level classes affecting content of extends in SASS
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
// 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