Last active
August 29, 2015 14:10
-
-
Save andrewabogado/daa3551376f26281f1d6 to your computer and use it in GitHub Desktop.
Extending a %placeholder selector within a media query block without resulting to compile error.
This file contains hidden or 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
.some-class { | |
color: blue; | |
} | |
@media (max-width: 800px) { | |
.some-class { | |
color: red; | |
} | |
} |
This file contains hidden or 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
// ---- | |
// Extending a %placeholder selector within a media query block without resulting to compile error. | |
// | |
// You may not @extend an outer selector from within @media. | |
// You may only @extend selectors within the same directive. | |
// From "@extend %icon" on line 8 of icons.scss | |
// | |
// Based on the solution presented at: http://thesassway.com/intermediate/understanding-placeholder-selectors | |
// ---- | |
%blue { | |
color: blue; | |
} | |
.some-class { | |
@extend %blue; | |
} | |
@media (max-width: 800px) { | |
%red { | |
color: red; | |
} | |
.some-class { | |
@extend %red; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment