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