Created
September 12, 2012 15:55
-
-
Save pfulton/3707635 to your computer and use it in GitHub Desktop.
Placeholder Selectors, Mixins and Media Queries: oh my!
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
/* THE BASE FILE WHERE YOU IMPORT ALL YOUR STUFF & MAYBE DO YOUR MEDIA QUERIES */ | |
@import "mixins"; | |
@media only screen and (min-width: 40.625em) { | |
@import "lib/placeholders"; | |
@import "layout/medium"; | |
} |
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
/* THE STYLES FOR "MEDIUM" SIZED SCREENS (AS DEFINED IN BASE.SCSS) */ | |
.this-thing { | |
@extend %thingie; | |
} | |
.this-other-thing { | |
@extend %alternate-thingie; | |
} |
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
/* A PLACE TO DEFINE YOUR "BASE/ORIGINAL" MIXINS */ | |
@mixin divider-bottom { | |
padding-bottom: 1em; | |
border-bottom: 1px solid $border-color; | |
margin-bottom: 1em; | |
} |
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
/* PLACEHOLDER SELECTORS. */ | |
%thingie { | |
background: red; | |
font-size: 1.25em; | |
width: 10%; | |
display: block; | |
} | |
%alternate-thingie { | |
@include divider-bottom; | |
} |
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
/* THE FINAL, COMPILED CSS */ | |
@media only screen and (min-width: 40.625em) { | |
.this-thing { | |
background: red; | |
font-size: 1.25em; | |
width: 10%; | |
display: block; | |
} | |
.this-other-thing { | |
padding-bottom: 1em; | |
border-bottom: 1px solid #dededb; | |
margin-bottom: 1em; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works, but is not ideal. Things get very inefficiently grouped inside of the media query files, which leads to code bloat.