Skip to content

Instantly share code, notes, and snippets.

@bcackerman
Last active December 29, 2015 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcackerman/7667435 to your computer and use it in GitHub Desktop.
Save bcackerman/7667435 to your computer and use it in GitHub Desktop.
Create a list of CSS elements that can be used in the view for margin/padding.
@each $property in margin, padding {
@each $location in top, right, bottom, left {
@for $i from 0 through 15 {
.#{$property}-#{$location}-#{$i * 10} { #{$property}-#{$location}: 10px * $i; }
}
}
}
@bcackerman
Copy link
Author

This will create a list of elements for margin/padding, top/right/bottom/left from 0px to 150px in increments of 10px.

Ex:

.padding-left-80 {
  padding-left: 80px;
}

.padding-left-90 {
  padding-left: 90px;
}

.padding-left-100 {
  padding-left: 100px;
}

.padding-left-110 {
  padding-left: 110px;
}

This is useful to use in your views (reusable elements).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment