Skip to content

Instantly share code, notes, and snippets.

@jarbitlira
Created April 7, 2016 23:55
Show Gist options
  • Save jarbitlira/3571aee06414c4286d882b7e889bb73a to your computer and use it in GitHub Desktop.
Save jarbitlira/3571aee06414c4286d882b7e889bb73a to your computer and use it in GitHub Desktop.
generate class helpers
.generateClasses(@propertyName, @prefixName) {
.properties(@counter, @to, @step: 10) when (@counter < @to) {
.properties((@counter + @step), @to, @step );
.@{prefixName}-@{counter} {
@{propertyName}: unit(@counter, px);
}
.@{prefixName}-top-@{counter} {
@{propertyName}-top: unit(@counter, px);
}
.@{prefixName}-bottom-@{counter} {
@{propertyName}-bottom: unit(@counter, px);
}
.@{prefixName}-left-@{counter} {
@{propertyName}-left: unit(@counter, px);
}
.@{prefixName}-right-@{counter} {
@{propertyName}-right: unit(@counter, px);
}
}
.properties(0, 100, 10);
}
.generateClasses(padding, pad);
.generateClasses(margin, mar);
@jarbitlira
Copy link
Author

image

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