Skip to content

Instantly share code, notes, and snippets.

@DarbyBrown
Created May 7, 2015 15:38
Show Gist options
  • Save DarbyBrown/6884592729d23e3bb777 to your computer and use it in GitHub Desktop.
Save DarbyBrown/6884592729d23e3bb777 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.0-beta.6)
// ----
$breakpoints: 480px 640px 900px;
@mixin cycle-breakpoints() {
@for $i from 1 through length($breakpoints) {
$i: $i !global;
$val: nth($breakpoints, $i);
@media only screen and (min-width: #{$val}) {
@content
}
}
}
div {
@include cycle-breakpoints {
padding: 2rem * $i;
}
}
@media only screen and (min-width: 480px) {
div {
padding: 2rem;
}
}
@media only screen and (min-width: 640px) {
div {
padding: 4rem;
}
}
@media only screen and (min-width: 900px) {
div {
padding: 6rem;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment