Skip to content

Instantly share code, notes, and snippets.

@cornellsteven
Last active November 20, 2019 20:18
Show Gist options
  • Save cornellsteven/6ba4f0b6f43118ffc17df439b218817d to your computer and use it in GitHub Desktop.
Save cornellsteven/6ba4f0b6f43118ffc17df439b218817d to your computer and use it in GitHub Desktop.
[Outlined labels mixin for Bootstrap 4.*]
@mixin label-outline-variant(
$color,
$color-hover: color-yiq($color),
$active-background: $color,
$active-border: $color
) {
color: $color;
border-color: $color;
&:hover {
color: $color-hover;
background-color: $active-background;
border-color: $active-border;
}
&:focus,
&.focus {
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
}
&:disabled,
&.disabled {
color: $color;
background-color: transparent;
}
&:not(:disabled):not(.disabled):active,
&:not(:disabled):not(.disabled).active,
.show > &.dropdown-toggle {
color: color-yiq($active-background);
background-color: $active-background;
border-color: $active-border;
&:focus {
@if $enable-shadows and $btn-active-box-shadow != none {
box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5);
} @else {
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
}
}
}
}
@each $color, $value in $theme-colors {
.label-outline-#{$color} {
@include label-outline-variant($value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment