Last active
August 29, 2015 14:20
-
-
Save samthurman/7980502c94d37e2c3280 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Sass (v3.4.13) | |
// Compass (v1.0.3) | |
// ---- | |
//breakpoint function, seems solid | |
@mixin media($breakpoint) { | |
$queries: ( | |
xs: 24rem, | |
sm: 40rem, | |
md: 52rem, | |
lg: 64rem, | |
); | |
@if $breakpoint == 'all' { | |
@content; | |
} @else { | |
@media (min-width: #{map-get($queries, $breakpoint)}) { | |
@content; | |
} | |
} | |
} | |
// putting groups of content into this mixin generates loads of unwanted code | |
@each $breakpoint in (all, xs, sm, md, lg) { | |
$breakpoint-prefix: if($breakpoint != all, "#{$breakpoint}-", null); | |
@include media($breakpoint) { | |
.#{$breakpoint-prefix}uses-breakpoints { | |
width: percentage(1/12); | |
} | |
.does-not-use-breakpoints { | |
display: block; | |
} | |
} | |
} |
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
.uses-breakpoints { | |
width: 8.33333%; | |
} | |
.does-not-use-breakpoints { | |
display: block; | |
} | |
@media (min-width: 24rem) { | |
.xs-uses-breakpoints { | |
width: 8.33333%; | |
} | |
.does-not-use-breakpoints { | |
display: block; | |
} | |
} | |
@media (min-width: 40rem) { | |
.sm-uses-breakpoints { | |
width: 8.33333%; | |
} | |
.does-not-use-breakpoints { | |
display: block; | |
} | |
} | |
@media (min-width: 52rem) { | |
.md-uses-breakpoints { | |
width: 8.33333%; | |
} | |
.does-not-use-breakpoints { | |
display: block; | |
} | |
} | |
@media (min-width: 64rem) { | |
.lg-uses-breakpoints { | |
width: 8.33333%; | |
} | |
.does-not-use-breakpoints { | |
display: block; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment