Forked from davidgilbertson/css-breakpoint-mixin-vars.scss
Last active
January 27, 2021 03:58
-
-
Save jaimeguaman/651e18daa8e3e451dc6fbbcf3b83fa17 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
/*************************************** | |
Responsive Helper | |
Usage: | |
.my-box { | |
padding: 10px; | |
@include for-size(tv) { | |
padding: 80px; | |
} | |
@include for-size(desktop-up) { | |
padding: 20px; | |
} | |
@include for-size(tv) { | |
padding: 80px; | |
} | |
} | |
**************************************/ | |
$phone-upper-boundary: 670px !default; | |
$tablet-portrait-upper-boundary: 900px !default; | |
$tablet-landscape-upper-boundary: 1024px !default; | |
$desktop-upper-boundary: 1280px !default; | |
$tv-upper-boundary: 1800px !default; | |
@mixin for-size($range) { | |
@if $range == phone-only { | |
@media (max-width: #{$phone-upper-boundary - 1}) { @content; } | |
} @else if $range == phone-only-landscape { | |
@media (max-width: #{$phone-upper-boundary - 1}) and (orientation: landscape) { @content; } | |
} @else if $range == tablet-portrait-up { | |
@media (min-width: $phone-upper-boundary) { @content; } | |
} @else if $range == tablet-landscape-up { | |
@media (min-width: $tablet-portrait-upper-boundary) { @content; } | |
} @else if $range == old-desktop-only { | |
@media (min-width: $tablet-landscape-upper-boundary) and (max-width: #{$desktop-upper-boundary - 1}) { @content; } | |
} @else if $range == desktop-up { | |
@media (min-width: $desktop-upper-boundary) { @content; } | |
} @else if $range == tv { | |
@media (min-width: $tv-upper-boundary) { @content; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment