Created
March 3, 2020 14:10
-
-
Save asha23/26809113ec0c11c11ee90800a4247f65 to your computer and use it in GitHub Desktop.
Create margins and padding using an scss loop
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
// Create a load of padding and margin classes | |
@for $i from 1 through 20 { | |
.mt-#{$i} { | |
margin-top:#{$i}rem!important; | |
} | |
.mb-#{$i} { | |
margin-bottom:#{$i}rem!important; | |
} | |
.pt-#{$i} { | |
padding-top:#{$i}rem!important; | |
} | |
.pb-#{$i} { | |
padding-bottom:#{$i}rem!important; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment