Skip to content

Instantly share code, notes, and snippets.

@bhalash
Created March 27, 2015 12:17
Show Gist options
  • Save bhalash/c0f15cb432b5cda2d301 to your computer and use it in GitHub Desktop.
Save bhalash/c0f15cb432b5cda2d301 to your computer and use it in GitHub Desktop.
@mixin breakpoint($point, $size: '') {
$cell_min: 200px;
$cell_max: 599px;
$tablet_min: 600px;
$tablet_max: 1024px;
@if $point == smartphone {
@media only screen and (min-device-width: $cell_min) and (max-device-width: $cell_max) and (orientation: portrait),
only screen and (min-device-width: $cell_min) and (max-device-width: $cell_max) and (orientation: landscape) {
@content;
}
}
@if $point == tablet {
@media only screen and (min-device-width: $tablet_min) and (max-device-width: $tablet_max) and (orientation: portrait),
only screen and (min-device-width: $tablet_min) and (max-device-width: $tablet_max) and (orientation: landscape) {
@content;
}
}
@if $point == portrait {
@media only screen and (orientation: portrait) {
@content;
}
}
@if $point == landscape {
@media only screen and (orientation: landscape) {
@content;
}
}
@if $point == max {
@media only screen and (max-width: $size + px) {
@content;
}
}
@if $point == min {
@media only screen and (min-width: $size + px) {
@content;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment