Last active
August 29, 2015 14:00
-
-
Save tyssen/11249562 to your computer and use it in GitHub Desktop.
Using SASS for creating mediaqueries
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
#content { | |
background-color: #fff; | |
clear: both; | |
overflow: hidden; | |
padding: 20px; | |
@include breakpoint(600) { | |
border: 2px solid $color1; | |
} | |
} | |
[role=main] { | |
position: relative; | |
@include breakpoint(720) { | |
.two-col & { | |
float: left; | |
width: 720px; | |
} | |
.home & { | |
width: 50% | |
} | |
} | |
} | |
[role=complementary] { | |
box-sizing: border-box; | |
@include breakpoint(720) { | |
.two-col & { | |
float: right; | |
width: 200px; | |
} | |
.home & { | |
padding-left: 40px; | |
width: 50%; | |
} | |
} | |
} | |
// Breakpoint mixin | |
$old-ie: false !default; | |
@mixin breakpoint($point) { | |
@if $old-ie { | |
@content; | |
} | |
@else { | |
@media only screen and (min-width: $point / 16 * 1em) { | |
@content; | |
} | |
} | |
} | |
// Main stylesheet | |
@charset "UTF-8"; | |
@import 'master'; | |
// Old IE stylesheet | |
@charset "UTF-8"; | |
$old-ie: true; | |
@import 'master'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment