Skip to content

Instantly share code, notes, and snippets.

@amboy00
Created August 20, 2013 19:25
Show Gist options
  • Save amboy00/6286007 to your computer and use it in GitHub Desktop.
Save amboy00/6286007 to your computer and use it in GitHub Desktop.
responsive padding.
$total-padding: 8;
@media only screen {
@for $x from 0 through $total-padding {
@for $y from 0 through $total-padding {
.small-padding-#{$x}-#{$y} {
padding-top: $x * 1em;
padding-bottom: $y * 1em;
}
}
}
}
@media only screen and (min-width: 768px) {
@for $x from 0 through $total-padding {
@for $y from 0 through $total-padding {
.medium-padding-#{$x}-#{$y} {
padding-top: $x * 1em;
padding-bottom: $y * 1em;
}
}
}
}
@media only screen and (min-width: 900px) {
@for $x from 0 through $total-padding {
@for $y from 0 through $total-padding {
.large-padding-#{$x}-#{$y} {
padding-top: $x * 1em;
padding-bottom: $y * 1em;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment