Last active
April 11, 2017 06:24
-
-
Save xto3na/d30e6603417baa760d91b8374af50585 to your computer and use it in GitHub Desktop.
Paddings and margins helpers generate in LESS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.interval-generator(@index: 0) when (@index <= 50) { | |
// Paddings with step 5px | |
.pt@{index} { | |
padding-top: ~"@{index}px"; | |
} | |
.pb@{index} { | |
padding-bottom: ~"@{index}px"; | |
} | |
.pl@{index} { | |
padding-left: ~"@{index}px"; | |
} | |
.pr@{index} { | |
padding-right: ~"@{index}px"; | |
} | |
// Margins with step 5px | |
.mt@{index} { | |
margin-top: ~"@{index}px"; | |
} | |
.mb@{index} { | |
margin-bottom: ~"@{index}px"; | |
} | |
.ml@{index} { | |
margin-left: ~"@{index}px"; | |
} | |
.mr@{index} { | |
margin-right: ~"@{index}px"; | |
} | |
// Recursive call | |
.interval-generator(@index + 5); | |
} | |
.interval-generator(5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment