Created
March 5, 2015 13:08
-
-
Save xar/78671d90c2c031eaed4b to your computer and use it in GitHub Desktop.
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
@mixin bp($point, $high:'', $low:'') { | |
/* XS */ | |
$mobile-max: 767; | |
$mobile-min: 1; | |
@if $point == xs { | |
@if $high != '' { | |
$mobile-max: $high; | |
} | |
@if $low != '' { | |
$mobile-min: $low; | |
} | |
} | |
/* SM */ | |
$portrait-min: 768; | |
$portrait-max: 991; | |
@if $point == sm { | |
@if $high != '' { | |
$portrait-max: $high; | |
} | |
@if $low != '' { | |
$portrait-min: $low; | |
} | |
} | |
/* MD */ | |
$tablet-min: 992; | |
$tablet-max: 1200; | |
@if $point == md { | |
@if $high != '' { | |
$tablet-max: $high; | |
} | |
@if $low != '' { | |
$tablet-min: $low; | |
} | |
} | |
/* LG */ | |
$desktop-min: 1200; | |
@if $point == lg { | |
@if $low != '' { | |
$desktop-min: $low; | |
} | |
} | |
$mobile: "(min-width: #{$mobile-min}px) and (max-width: #{$mobile-max}px)"; | |
$portrait: "(min-width: #{$portrait-min}px) and (max-width: #{$portrait-max}px)"; | |
$tablet: "(min-width: #{$tablet-min}px) and (max-width: #{$tablet-max}px)"; | |
$desktop: "(min-width: #{$desktop-min}px)"; | |
@if $point == xs { | |
@media #{$mobile} { @content; } | |
} | |
@else if $point == md { | |
@media #{$tablet} { @content; } | |
} | |
@else if $point == sm { | |
@media #{$portrait} { @content; } | |
} | |
@else if $point == lg { | |
@media #{$desktop} { @content; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment