Skip to content

Instantly share code, notes, and snippets.

@una
Created April 18, 2015 18:59
Show Gist options
  • Save una/453580a9dc26f311773d to your computer and use it in GitHub Desktop.
Save una/453580a9dc26f311773d to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$breakpoints: (
'break-1': 600px,
'break-2': 800px
);
@mixin breakpoint($name) {
@if not map-has-key($breakpoints, $name) {
@warn "Invalid breakpoint `#{$name}`.";
}
@else {
@media (min-width: map-get($breakpoints, $name)) {
@content;
}
}
}
div {
width: 100%;
height: 100px;
display: block;
background: blue;
@include breakpoint(break-1) {
background: red;
}
}
div {
width: 100%;
height: 100px;
display: block;
background: blue;
}
@media (min-width: 600px) {
div {
background: red;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment