Last active
August 29, 2015 14:15
-
-
Save micha149/d38edb6862b292da67e7 to your computer and use it in GitHub Desktop.
Exclude Mobile CSS into separate stylesheet
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
@import "mixins"; | |
body { | |
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
} | |
.container { | |
width: 960px; | |
margin: 0 auto; | |
@include respond-to(small) { | |
width: 100%; | |
margin: 0; | |
} | |
@include respond-to(large) { | |
background: url(fancyLargeImage.jpg); | |
} | |
} |
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
$isMobile: false !default; | |
@mixin respond-to($media) { | |
@if $media == small and $isMobile { | |
@content; | |
} | |
@else if $media == small { | |
@media only screen and (max-width: 479px) { @content; } | |
} | |
@else if $media == medium and not $isMobile { | |
@media only screen and (min-width: 480px) and (max-width: 767px) { @content; } | |
} | |
@else if $media == large and not $isMobile { | |
@media only screen and (min-width: 768px) and (max-width: 959px) { @content; } | |
} | |
} |
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
$isMobile: true; | |
@import "main"; |
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
@import "main"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment