Previously deprecated in v4.x, this clears out the now unused Sass option and removes some unused mixins. Arguably we could remove more, but I like the hover-focus mixin and we make extensive use of it across the project.
// Bring the hover, focused, and "active" buttons to the front to overlay
// the borders properly
- @include hover {
- z-index: 1;
- }
+ &:hover,
&:focus,
&:active,
&.active {
@include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-line-height, $btn-border-radius);
@include transition($btn-transition);
- @include hover {
+ &:hover {
color: $body-color;
text-decoration: none;
}
color: $btn-link-color;
text-decoration: $link-decoration;
- @include hover {
+ &:hover {
color: $btn-link-hover-color;
text-decoration: $link-hover-decoration;
}
}
.card-link {
- @include hover {
+ &:hover {
text-decoration: none;
}
@include transition($carousel-control-transition);
// Hover/focus state
- @include hover-focus {
+ &:hover,
+ &:focus {
color: $carousel-control-color;
text-decoration: none;
outline: 0;
opacity: .5;
// Override <a>'s hover style
- @include hover {
+ &:hover {
color: $close-color;
text-decoration: none;
}
&:not(:disabled):not(.disabled) {
- @include hover-focus {
+ &:hover,
+ &:focus {
opacity: .75;
}
}
}
}
- @include hover-focus {
+ &:hover,
+ &:focus {
color: $dropdown-link-hover-color;
text-decoration: none;
@include gradient-bg($dropdown-link-hover-bg);
text-align: inherit; // For `<button>`s (anchors inherit)
// Hover state
- @include hover-focus {
+ &:hover,
+ &:focus {
z-index: 1; // Place hover/focus items above their siblings for proper border styling
color: $list-group-action-hover-color;
text-decoration: none;
// Utilities
@import "mixins/breakpoints";
-@import "mixins/hover";
@import "mixins/image";
@import "mixins/resize";
@import "mixins/screen-reader";
display: block;
padding: $nav-link-padding-y $nav-link-padding-x;
- @include hover-focus {
+ &:hover,
+ &:focus {
text-decoration: none;
}
border: $nav-tabs-border-width solid transparent;
@include border-top-radius($nav-tabs-border-radius);
- @include hover-focus {
+ &:hover,
+ &:focus {
border-color: $nav-tabs-link-hover-border-color;
}
line-height: inherit;
white-space: nowrap;
- @include hover-focus {
+ &:hover,
+ &:focus {
text-decoration: none;
}
}
border: $border-width solid transparent; // remove default button style
@include border-radius($navbar-toggler-border-radius);
- @include hover-focus {
+ &:hover,
+ &:focus {
text-decoration: none;
}
}
.navbar-brand {
color: $navbar-light-brand-color;
- @include hover-focus {
+ &:hover,
+ &:focus {
color: $navbar-light-brand-hover-color;
}
}
.nav-link {
color: $navbar-light-color;
- @include hover-focus {
+ &:hover,
+ &:focus {
color: $navbar-light-hover-color;
}
.navbar-text {
color: $navbar-light-color;
- a {
- color: $navbar-light-active-color;
- @include hover-focus {
- color: $navbar-light-active-color;
- }
+ a,
+ a:hover,
+ a:focus {
+ color: $navbar-light-active-color;
}
}
}
.navbar-brand {
color: $navbar-dark-brand-color;
- @include hover-focus {
+ &:hover,
+ &:focus {
color: $navbar-dark-brand-hover-color;
}
}
.nav-link {
color: $navbar-dark-color;
- @include hover-focus {
+ &:hover,
+ &:focus {
color: $navbar-dark-hover-color;
}
.navbar-text {
color: $navbar-dark-color;
- a {
+ a,
+ a:hover,
+ a:focus {
color: $navbar-dark-active-color;
-
- @include hover-focus {
- color: $navbar-dark-active-color;
- }
}
}
}
text-decoration: $link-decoration;
background-color: transparent; // Remove the gray background on active links in IE 10.
- @include hover {
+ &:hover {
color: $link-hover-color;
text-decoration: $link-hover-decoration;
}
// See https://github.com/twbs/bootstrap/issues/19402
a:not([href]):not([tabindex]) {
- color: inherit;
- text-decoration: none;
-
- @include hover-focus {
+ &,
+ &:hover,
+ &:focus {
color: inherit;
text-decoration: none;
- }
-
- &:focus {
outline: 0;
}
}
.table-hover {
tbody tr {
- @include hover {
+ &:hover {
color: $table-hover-color;
background-color: $table-hover-bg;
}
&.table-hover {
tbody tr {
- @include hover {
+ &:hover {
color: $table-dark-hover-color;
background-color: $table-dark-hover-bg;
}
$enable-gradients: false !default;
$enable-transitions: true !default;
$enable-prefers-reduced-motion-media-query: true !default;
-$enable-hover-media-query: false !default; // Deprecated, no longer affects any compiled CSS
$enable-grid-classes: true !default;
$enable-pointer-cursor-for-buttons: true !default;
$enable-print-styles: true !default;
border-color: $border;
@include box-shadow($btn-box-shadow);
- @include hover {
+ &:hover {
color: color-yiq($hover-background);
@include gradient-bg($hover-background);
border-color: $hover-border;
color: $color;
border-color: $color;
- @include hover {
+ &:hover {
color: $color-hover;
background-color: $active-background;
border-color: $active-border;
+++ /dev/null
-// Hover mixin and `$enable-hover-media-query` are deprecated.
-//
-// Originally added during our alphas and maintained during betas, this mixin was
-// designed to prevent `:hover` stickiness on iOS-an issue where hover styles
-// would persist after initial touch.
-//
-// For backward compatibility, we've kept these mixins and updated them to
-// always return their regular pseudo-classes instead of a shimmed media query.
-//
-// Issue: https://github.com/twbs/bootstrap/issues/25195
-
-@mixin hover {
- &:hover { @content; }
-}
-
-@mixin hover-focus {
- &:hover,
- &:focus {
- @content;
- }
-}
-
-@mixin plain-hover-focus {
- &,
- &:hover,
- &:focus {
- @content;
- }
-}
-
-@mixin hover-focus-active {
- &:hover,
- &:focus,
- &:active {
- @content;
- }
-}
background-color: $background;
&.list-group-item-action {
- @include hover-focus {
+ &:hover,
+ &:focus {
color: $color;
background-color: darken($background, 5%);
}
$hover-background: darken($background, 5%);
.table-#{$state} {
- @include hover {
+ &:hover {
background-color: $hover-background;
> td,
}
@if $emphasized-link-hover-darken-percentage != 0 {
a#{$parent} {
- @include hover-focus {
+ &:hover,
+ &:focus {
color: darken($color, $emphasized-link-hover-darken-percentage) !important;
}
}
Changes to our source Sass files and compiled CSS.
+- Removed `hover`, `hover-focus`, `plain-hover-focus`, and `hover-focus-active` mixins. Use regular CSS syntax for these moving forward. [See #28267](https://github.com/twbs/bootstrap/pull/28267).
- **Todo:** Remove previously deprecated mixins
- `float()`
- `form-control-mixin()`
background-color: $bd-purple;
outline: 0;
- @include hover {
+ &:hover {
color: $white;
}
}