Skip to content

Instantly share code, notes, and snippets.

@kuanhsuh
Created April 29, 2017 00:06
Show Gist options
  • Save kuanhsuh/5d8453ec76fb415e07140e67bc555c19 to your computer and use it in GitHub Desktop.
Save kuanhsuh/5d8453ec76fb415e07140e67bc555c19 to your computer and use it in GitHub Desktop.
Mixins-Add Borders( size, color, position) && add-background-color ( color)
@mixin add-border($size, $color, $position){
@if $position == 'all'{
border: $size solid $color;
} @else if $position == 'top' {
border-top: $size solid $color;
} @else if $position == 'bottom' {
border-bottom: $size solid $color;
} @else if $position == 'right' {
border-right: $size solid $color;
} @else if $position == 'left' {
border-left: $size solid $color;
} @else if $position == 'top-bottom' {
border-top: $size solid $color;
border-bottom: $size solid $color;
} @else if $position == 'right-left' {
border-left: $size solid $color;
border-right: $size solid $color;
}
}
@mixin add-background($color){
background: $color;
@if $color == $light-color {
color: #666;
} @else {
color: #fff;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment