Created
March 9, 2014 17:19
-
-
Save iraycd/9451089 to your computer and use it in GitHub Desktop.
Max-Points and Min-Points. Foundation Framework
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
// | |
// @functions | |
// | |
// RANGES | |
// We use these functions to define ranges for various things, like media queries. | |
@function lower-bound($range){ | |
@if length($range) <= 0 { | |
@return 0; | |
} | |
@return nth($range,1); | |
} | |
@function upper-bound($range) { | |
@if length($range) < 2 { | |
@return 999999999999; | |
} | |
@return nth($range, 2); | |
} | |
// Media Query Ranges | |
$small-range: (0em, 40em); | |
$medium-range: (40.063em, 64em); | |
$large-range: (64.063em, 90em); | |
$xlarge-range: (90.063em, 120em); | |
$xxlarge-range: (120.063em); | |
$screen: "only screen"; | |
$landscape: "#{$screen} and (orientation: landscape)"; | |
$portrait: "#{$screen} and (orientation: portrait)"; | |
$small-up: $screen; | |
$small-only: "#{$screen} and (max-width: #{upper-bound($small-range)})"; | |
$medium-up: "#{$screen} and (min-width:#{lower-bound($medium-range)})"; | |
$medium-only: "#{$screen} and (min-width:#{lower-bound($medium-range)}) and (max-width:#{upper-bound($medium-range)})"; | |
$large-up: "#{$screen} and (min-width:#{lower-bound($large-range)})"; | |
$large-only: "#{$screen} and (min-width:#{lower-bound($large-range)}) and (max-width:#{upper-bound($large-range)})"; | |
$xlarge-up: "#{$screen} and (min-width:#{lower-bound($xlarge-range)})"; | |
$xlarge-only: "#{$screen} and (min-width:#{lower-bound($xlarge-range)}) and (max-width:#{upper-bound($xlarge-range)})"; | |
$xxlarge-up: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)})"; | |
$xxlarge-only: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)}) and (max-width:#{upper-bound($xxlarge-range)})"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment