Skip to content

Instantly share code, notes, and snippets.

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