Created
March 25, 2015 16:17
-
-
Save JordanForeman/ea224533c9c1ed9c9224 to your computer and use it in GitHub Desktop.
Sass Media Queries for Progressive Enhancement
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
| /* These numbers are all arbitrary; feel free to tweak them to your liking/needs */ | |
| $mobileBreakpoint: 360px; | |
| $tableBreakpoint: 720px; | |
| $desktopBreakpoint: 1080px; | |
| @mixin breakpoint($bp) { | |
| /* Use min-width for a progressive-enhancement approach */ | |
| @media screen and (min-width: $bp) { @content } | |
| } | |
| @mixin mobile() { @include breakpoint($mobileBreakpoint); } | |
| @mixin tablet() { @include breakpoint($tabletBreakpoint); } | |
| @mixin desktop() { @include breakpoint($desktopBreakpoint); } | |
| .custom-class { | |
| /* BASE STYLES */ | |
| @include breakpoint(123px){/* CUSTOM BREAKPOINT STYLES */} | |
| @include mobile {/* Mobile Styles */} | |
| @include tablet {/* Tablet Styles */} | |
| @include desktop {/* Desktop Styles */} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment