Skip to content

Instantly share code, notes, and snippets.

@pjschreifels
Created January 9, 2014 17:59
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pjschreifels/8338799 to your computer and use it in GitHub Desktop.
Save pjschreifels/8338799 to your computer and use it in GitHub Desktop.
#sass #css-layout — Margin and Padding loop for SASS.
// Margins and Padding
// -------------------------
$i: 0;
@while $i <= 50 {
.mt#{$i} { margin-top: 1px * $i; }
.mb#{$i} { margin-bottom: 1px * $i; }
.ml#{$i} { margin-left: 1px * $i; }
.mr#{$i} { margin-right: 1px * $i; }
.pt#{$i} { padding-top: 1px * $i; }
.pb#{$i} { padding-bottom: 1px * $i; }
.pl#{$i} { padding-left: 1px * $i; }
.pr#{$i} { padding-right: 1px * $i; }
$i: $i + 5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment