Skip to content

Instantly share code, notes, and snippets.

@sunnyluthra
Created September 9, 2015 07:53
Show Gist options
  • Save sunnyluthra/77bb11f50c01551e462c to your computer and use it in GitHub Desktop.
Save sunnyluthra/77bb11f50c01551e462c to your computer and use it in GitHub Desktop.
Padding Class Generator
@mixin class-generator($classNamespace, $fromValue, $toValue, $multiple, $property, $unit) {
@for $i from $fromValue to $toValue {
.#{$classNamespace}#{$i*$multiple} {
#{$property}: #{$i*$multiple}#{$unit};
}
}
}
@include class-generator(pt, 0, 25, 5, padding-top, px);
@sunnyluthra
Copy link
Author

.pt0 {
  padding-top: 0px; }

.pt5 {
  padding-top: 5px; }

.pt10 {
  padding-top: 10px; }

.pt15 {
  padding-top: 15px; }

.pt20 {
  padding-top: 20px; }

.pt25 {
  padding-top: 25px; }

.pt30 {
  padding-top: 30px; }

.pt35 {
  padding-top: 35px; }

.pt40 {
  padding-top: 40px; }

.pt45 {
  padding-top: 45px; }

.pt50 {
  padding-top: 50px; }

.pt55 {
  padding-top: 55px; }

.pt60 {
  padding-top: 60px; }

.pt65 {
  padding-top: 65px; }

.pt70 {
  padding-top: 70px; }

.pt75 {
  padding-top: 75px; }

.pt80 {
  padding-top: 80px; }

.pt85 {
  padding-top: 85px; }

.pt90 {
  padding-top: 90px; }

.pt95 {
  padding-top: 95px; }

.pt100 {
  padding-top: 100px; }

.pt105 {
  padding-top: 105px; }

.pt110 {
  padding-top: 110px; }

.pt115 {
  padding-top: 115px; }

.pt120 {
  padding-top: 120px; }

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