Forked from davidgilbertson/css-breakpoint-mixin-1.scss
Last active
December 13, 2016 15:56
-
-
Save vicainelli/6f93595f40a9c31d1cdce30f7053a1bd 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 for-size($size) { | |
@if $size == phone-only { | |
@media (max-width: 599px) { @content; } | |
} @else if $size == tablet-portrait-up { | |
@media (min-width: 600px) { @content; } | |
} @else if $size == tablet-landscape-up { | |
@media (min-width: 900px) { @content; } | |
} @else if $size == desktop-up { | |
@media (min-width: 1200px) { @content; } | |
} @else if $size == big-desktop-up { | |
@media (min-width: 1800px) { @content; } | |
} | |
} | |
// usage | |
.my-box { | |
padding: 10px; | |
@include for-size(desktop-up) { | |
padding: 20px; | |
} | |
} |
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 for-size($size) | |
@if $size == phone-only | |
@media (max-width: 599px) | |
@content | |
@else if $size == tablet-portrait-up | |
@media (min-width: 600px) | |
@content | |
@else if $size == tablet-landscape-up | |
@media (min-width: 900px) | |
@content | |
@else if $size == desktop-up | |
@media (min-width: 1200px) | |
@content | |
@else if $size == big-desktop-up | |
@media (min-width: 1800px) | |
@content | |
// usage | |
.my-box | |
padding: 10px | |
@include for-size(desktop-up) | |
padding: 20px |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment