Skip to content

Instantly share code, notes, and snippets.

@jayaregalinada
Created April 25, 2016 02:16
Show Gist options
  • Save jayaregalinada/7631ccb86227f0cc675659e47f1a3d52 to your computer and use it in GitHub Desktop.
Save jayaregalinada/7631ccb86227f0cc675659e47f1a3d52 to your computer and use it in GitHub Desktop.
Sass Mixin for Paddings
@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