Skip to content

Instantly share code, notes, and snippets.

@macx
Created January 26, 2016 17:46
Show Gist options
  • Save macx/f2359cbca0f0b2216339 to your computer and use it in GitHub Desktop.
Save macx/f2359cbca0f0b2216339 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
$layout-breakpoints: (
small: 480px,
medium: 600px,
large: 1024px,
xlarge: 1300px,
xxlarge: 1600px,
xxxlarge: 1900px
);
@mixin respond($breakpoint, $type: 'from') {
@if $type == 'from' {
@media screen and (min-width: map-get($layout-breakpoints, $breakpoint)) {
@content;
}
} @else if $type == 'to' {
@media screen and (max-width: map-get($layout-breakpoints, $breakpoint)) {
@content;
}
}
}
body {
background: red;
@include respond('small') {
background: orange;
}
@include respond('medium') {
background: green;
}
@include respond('large') {
background: lightgreen;
}
}
body {
background: red;
}
@media screen and (min-width: 480px) {
body {
background: orange;
}
}
@media screen and (min-width: 600px) {
body {
background: green;
}
}
@media screen and (min-width: 1024px) {
body {
background: lightgreen;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment