Skip to content

Commit b7141de

Browse files
committed
Fixes #2228: @extend is creating an absurdly big selector for hybrid buttons
1 parent 317f126 commit b7141de

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

src/Presentation/SmartStore.Web/Content/shared/_buttons.scss

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -464,42 +464,37 @@ $btn-size-sm: $input-height-sm;
464464

465465
// btn-to-[danger|primary]
466466
// --------------------------------------------------
467+
468+
@mixin button-hybrid-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 10%), $active-border: darken($border, 12.5%)) {
469+
// The mixin parameters were copied over from Bootstrap's original button-variant() mixin
470+
transition: box-shadow .15s ease-in-out;
471+
472+
&:not([disabled]):not(.disabled):hover {
473+
color: color-yiq($hover-background);
474+
@include gradient-bg($hover-background);
475+
border-color: $hover-border;
476+
477+
> i {
478+
opacity: 1;
479+
}
480+
}
481+
482+
&:hover:focus {
483+
box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5) !important;
484+
}
485+
}
486+
467487
.btn.btn-to-danger,
468488
.btn.btn-to-primary {
469489
transition: box-shadow .15s ease-in-out;
470490
}
471491

472492
.btn.btn-to-danger {
473-
&:not([disabled]):not(.disabled):hover {
474-
@extend .btn-danger:hover;
475-
> i { opacity: 1; }
476-
}
477-
478-
&:focus:hover {
479-
@extend .btn-danger:focus;
480-
> i { opacity: 1; }
481-
}
482-
483-
&:not([disabled]):not(.disabled):active,
484-
.show > &.dropdown-toggle {
485-
@extend .btn-danger:active;
486-
> i { opacity: 1; }
487-
}
493+
@include button-hybrid-variant($danger, $danger);
488494
}
489495

490496
.btn.btn-to-primary {
491-
&:not([disabled]):not(.disabled):hover {
492-
@extend .btn-primary:hover;
493-
}
494-
495-
&:focus:hover {
496-
@extend .btn-primary:focus;
497-
}
498-
499-
&:not([disabled]):not(.disabled):active,
500-
.show > &.dropdown-toggle {
501-
@extend .btn-primary:active;
502-
}
497+
@include button-hybrid-variant($primary, $primary);
503498
}
504499

505500
// btn-no-border

0 commit comments

Comments
 (0)