Created
April 25, 2016 02:16
-
-
Save jayaregalinada/7631ccb86227f0cc675659e47f1a3d52 to your computer and use it in GitHub Desktop.
Sass Mixin for Paddings
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
@mixin padding($size, $position: false) { | |
@if $position == false { | |
padding: $size !important; | |
} | |
@else { | |
padding-#{$position}: $size !important; | |
} | |
} | |
.no-padding { | |
@include padding(0); | |
} | |
@each $position in top, right, bottom, left { | |
.no-padding-#{$position} { | |
@include padding(0, $position); | |
} | |
@for $i from 1 through 50 { | |
@if $i % 10 == 0 { | |
.padding-#{$position}-#{$i} { | |
@include padding($i * 1px, $position); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment