Skip to content

Commit

Permalink
Try to fix the dropdown-toggle-split
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond committed Feb 25, 2022
1 parent e235e4b commit 72f427b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
17 changes: 16 additions & 1 deletion scss/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,23 @@
&:not(:hover):not(:focus):not(:active) {
border-left-color: transparent;

&.btn-inverse::before {
&.btn-inverse {
color: $white;
background-color: $black;
border-color: $white;

&::before {
background-color: $black;
}
}
}

&:active,
&.active {
border-left: 2px solid $black !important; // stylelint-disable-line declaration-no-important

&.btn-inverse {
border-left: 2px solid $primary !important; // stylelint-disable-line declaration-no-important
}
}

Expand Down
23 changes: 7 additions & 16 deletions scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
--#{$variable-prefix}btn-border-radius: #{$btn-border-radius};
--#{$variable-prefix}btn-box-shadow: #{$btn-box-shadow};
--#{$variable-prefix}btn-disabled-opacity: #{$btn-disabled-opacity};
--#{$variable-prefix}btn-focus-box-shadow: 0 0 0 #{$btn-focus-width} rgba(var(--#{$variable-prefix}btn-focus-shadow-rgb), .5);
--#{$variable-prefix}btn-focus-box-shadow: 0 0 0 #{$btn-focus-width} var(--#{$variable-prefix}btn-focus-shadow-rgb); // Boosted mod
--#{$boosted-variable-prefix}icon-spacing: #{$btn-icon-padding-x}; // Boosted mod
// scss-docs-end btn-css-vars

Expand Down Expand Up @@ -79,16 +79,7 @@
background-image: if($enable-gradients, none, null);
border-color: var(--#{$variable-prefix}btn-active-border-color);
outline-color: var(--#{$variable-prefix}btn-active-border-color); // Boosted mod
@include box-shadow(var(--#{$variable-prefix}btn-active-shadow));

&:focus {
// Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows {
box-shadow: var(--#{$variable-prefix}btn-active-shadow), var(--#{$variable-prefix}btn-focus-box-shadow);
} @else {
box-shadow: var(--#{$variable-prefix}btn-focus-box-shadow);
}
}
// Boosted mod: no box shadow modification for the active state
}

&:disabled,
Expand Down Expand Up @@ -121,37 +112,37 @@
.btn-warning {
@include button-variant($primary, $primary, $active-background: $white, $active-border: $black);
&.btn-inverse {
@include button-variant($primary, $primary, $black, $white, $white, $black, $black, $white, $white, $gray-700, $gray-700, $black);
@include button-variant($primary, $primary, $black, $white, $white, $black, $black, $white, $white, $gray-700, $gray-700, $black, true);
}
}

.btn-light,
.btn-secondary {
@include button-variant($white, $black, $disabled-background: $white, $disabled-border: $gray-500, $disabled-color: $gray-500);
&.btn-inverse {
@include button-variant($black, $white, $white, $white, $white, $black, $primary, $primary, $black, transparent, $gray-700, $gray-700);
@include button-variant($black, $white, $white, $white, $white, $black, $primary, $primary, $black, transparent, $gray-700, $gray-700, true);
}
}

.btn-success {
@include button-variant($success, $success);
&.btn-inverse {
@include button-variant($success, $success, $black, $white, $white, $black, $primary, $primary, $black, $gray-700, $gray-700, $black);
@include button-variant($success, $success, $black, $white, $white, $black, $primary, $primary, $black, $gray-700, $gray-700, $black, true);
}
}

.btn-info,
.btn-dark {
@include button-variant($black, $black, $white, $white, $black, $black);
&.btn-inverse {
@include button-variant($white, $white, $black, $black, $white, $white, $primary, $primary, $black, $gray-700, $gray-700, $black);
@include button-variant($white, $white, $black, $black, $white, $white, $primary, $primary, $black, $gray-700, $gray-700, $black, true);
}
}

.btn-danger {
@include button-variant($danger, $danger);
&.btn-inverse {
@include button-variant($danger, $danger, $white, $white, $white, $black, $primary, $primary, $black, $gray-700, $gray-700, $black);
@include button-variant($danger, $danger, $white, $white, $white, $black, $primary, $primary, $black, $gray-700, $gray-700, $black, true);
}
}
// scss-docs-end btn-variant-loops
Expand Down
15 changes: 12 additions & 3 deletions scss/mixins/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
//
// Boosted mod: Extra parameter to handle inverted buttons and their box shadows

// scss-docs-start btn-variant-mixin
@mixin button-variant(
Expand All @@ -18,19 +20,26 @@
$active-color: color-contrast($active-background),
$disabled-background: $gray-500, // Boosted mod
$disabled-border: $gray-500, // Boosted mod
$disabled-color: $white // Boosted mod
$disabled-color: $white, // Boosted mod
$inverted: false // Boosted mod
) {
--#{$variable-prefix}btn-color: #{$color};
--#{$variable-prefix}btn-bg: #{$background};
--#{$variable-prefix}btn-border-color: #{$border};
--#{$variable-prefix}btn-hover-color: #{$hover-color};
--#{$variable-prefix}btn-hover-bg: #{$hover-background};
--#{$variable-prefix}btn-hover-border-color: #{$hover-border};
--#{$variable-prefix}btn-focus-shadow-rgb: $border; // Boosted mod
// Boosted mod
@if $inverted {
--#{$variable-prefix}btn-focus-shadow-rgb: #{$color};
} @else {
--#{$variable-prefix}btn-focus-shadow-rgb: #{$hover-color};
}
// End mod
--#{$variable-prefix}btn-active-color: #{$active-color};
--#{$variable-prefix}btn-active-bg: #{$active-background};
--#{$variable-prefix}btn-active-border-color: #{$active-border};
--#{$variable-prefix}btn-active-shadow: #{$btn-active-box-shadow};
// Boosted mod: no definition of --#{$variable-prefix}btn-active-shadow
--#{$variable-prefix}btn-disabled-color: #{$disabled-color};
--#{$variable-prefix}btn-disabled-bg: #{$disabled-background};
--#{$variable-prefix}btn-disabled-border-color: #{$disabled-border};
Expand Down

0 comments on commit 72f427b

Please sign in to comment.