Created
December 11, 2012 14:49
-
-
Save kennyadsl/4259075 to your computer and use it in GitHub Desktop.
Scss responsive mixin
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
/* Devices sizes */ | |
$tablet-width: 768px; | |
$mobile-width: 420px; | |
/* Responsive breakpoints */ | |
$break-small: $mobile-width; | |
$break-large: $tablet-width; | |
@mixin respond-to($media) { | |
@if $media == mobile { | |
@media only screen and (max-width: $break-small) { @content; } | |
} | |
@else if $media == tablet { | |
@media only screen and (max-width: $break-large - 1) { @content; } | |
} | |
@else if $media == desktop { | |
@media only screen and (min-width: $break-large) { @content; } | |
} | |
} |
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
a { | |
margin: 0; | |
@include respond-to(tablet) { margin: 0 20px 0 0; } | |
@include respond-to(mobile) { margin: 0 0 10px 0; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment