Skip to content

Instantly share code, notes, and snippets.

@micha149
Last active August 29, 2015 14:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micha149/d38edb6862b292da67e7 to your computer and use it in GitHub Desktop.
Save micha149/d38edb6862b292da67e7 to your computer and use it in GitHub Desktop.
Exclude Mobile CSS into separate stylesheet
@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);
}
}
$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; }
}
}
$isMobile: true;
@import "main";
@import "main";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment