Skip to content

Instantly share code, notes, and snippets.

@andrewabogado
Last active August 29, 2015 14:10
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 andrewabogado/daa3551376f26281f1d6 to your computer and use it in GitHub Desktop.
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.
.some-class {
color: blue;
}
@media (max-width: 800px) {
.some-class {
color: red;
}
}
// ----
// 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