Skip to content

Instantly share code, notes, and snippets.

@tkawa
Created November 1, 2016 01:47
Show Gist options
  • Save tkawa/50d1cb8049a0e210ba91fcb06698e89e to your computer and use it in GitHub Desktop.
Save tkawa/50d1cb8049a0e210ba91fcb06698e89e to your computer and use it in GitHub Desktop.
Bootstrap Outline Buttons
// Backports from Bootstrap 4
@mixin button-outline-variant($color, $color-hover: #fff) {
color: $color;
background-image: none;
background-color: white; // transparent is better?
border-color: $color;
&:hover {
color: $color-hover;
background-color: $color;
border-color: $color;
}
&:focus,
&.focus {
color: $color-hover;
background-color: $color;
border-color: $color;
}
&:active,
&.active,
.open > &.dropdown-toggle {
color: $color-hover;
background-color: $color;
border-color: $color;
&:hover,
&:focus,
&.focus {
color: $color-hover;
background-color: darken($color, 17%);
border-color: darken($color, 25%);
}
}
&.disabled,
&:disabled {
&:focus,
&.focus {
border-color: lighten($color, 20%);
}
&:hover {
border-color: lighten($color, 20%);
}
}
}
// Remove all backgrounds
.btn-outline-primary {
@include button-outline-variant($btn-primary-bg);
}
//.btn-outline-secondary {
// @include button-outline-variant($btn-secondary-border);
//}
.btn-outline-info {
@include button-outline-variant($btn-info-bg);
}
.btn-outline-success {
@include button-outline-variant($btn-success-bg);
}
.btn-outline-warning {
@include button-outline-variant($btn-warning-bg);
}
.btn-outline-danger {
@include button-outline-variant($btn-danger-bg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment