]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Drop all hover mixins
authorMark Otto <markdotto@gmail.com>
Mon, 17 Sep 2018 23:10:07 +0000 (02:10 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 8 May 2019 17:58:07 +0000 (20:58 +0300)
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.

20 files changed:
scss/_button-group.scss
scss/_buttons.scss
scss/_card.scss
scss/_carousel.scss
scss/_close.scss
scss/_dropdown.scss
scss/_list-group.scss
scss/_mixins.scss
scss/_nav.scss
scss/_navbar.scss
scss/_reboot.scss
scss/_tables.scss
scss/_variables.scss
scss/mixins/_buttons.scss
scss/mixins/_hover.scss [deleted file]
scss/mixins/_list-group.scss
scss/mixins/_table-row.scss
scss/mixins/_text-emphasis.scss
site/content/docs/4.3/migration.md
site/static/docs/4.3/assets/scss/_skippy.scss

index d7220029ad180bf28266b90ad95445b0f57f610e..e486d469d9fc0a587142066dcb950d188aeb1f69 100644 (file)
@@ -13,9 +13,7 @@
 
     // Bring the hover, focused, and "active" buttons to the front to overlay
     // the borders properly
-    @include hover {
-      z-index: 1;
-    }
+    &:hover,
     &:focus,
     &:active,
     &.active {
index 5a684a3ff0fe879fd76fd56d087b86f2a96f1934..2adce28b47f6296f9488f4990e0f9afaf39ff7ec 100644 (file)
@@ -17,7 +17,7 @@
   @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;
   }
@@ -79,7 +79,7 @@ fieldset:disabled a.btn {
   color: $btn-link-color;
   text-decoration: $link-decoration;
 
-  @include hover {
+  &:hover {
     color: $btn-link-hover-color;
     text-decoration: $link-hover-decoration;
   }
index c0b2078c1c76d5a1ec76c1cdf78c7bacb6c868a7..5deefeeed6be1fc70f70b167cafc342e19aa7ec5 100644 (file)
@@ -53,7 +53,7 @@
 }
 
 .card-link {
-  @include hover {
+  &:hover {
     text-decoration: none;
   }
 
index 20ea04baf4e350bc4e5a26ef09a7a4e6349e9f41..0635a4acd5139b2e8267e2332f4694cedbd220c8 100644 (file)
   @include transition($carousel-control-transition);
 
   // Hover/focus state
-  @include hover-focus {
+  &:hover,
+  &:focus {
     color: $carousel-control-color;
     text-decoration: none;
     outline: 0;
index 5cc96f573e1678cfbaebf33f4b049b45f225fcb1..4f92022c879890853ab6f0e59e0ba0321b42c3df 100644 (file)
@@ -8,13 +8,14 @@
   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;
     }
   }
index ba8674e929c09cc467988df0591e5da2d37bf060..3f46641541ecebe30ae1a245d17ad85c1ed75113 100644 (file)
     }
   }
 
-  @include hover-focus {
+  &:hover,
+  &:focus {
     color: $dropdown-link-hover-color;
     text-decoration: none;
     @include gradient-bg($dropdown-link-hover-bg);
index 3f80687ab4869da1a9e3a21bc8be542b369d070f..71edfb2d342857cc5fc14fe58fef9d1180be3516 100644 (file)
@@ -23,7 +23,8 @@
   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;
index afbdd6ff5e3f7bacb577b3ff1bb3ccc481eb3939..a8be120638e4e1e077d1f1024f371d406cf1b67e 100644 (file)
@@ -10,7 +10,6 @@
 
 // Utilities
 @import "mixins/breakpoints";
-@import "mixins/hover";
 @import "mixins/image";
 @import "mixins/resize";
 @import "mixins/screen-reader";
index 2085d06f6742f4d1ef11fc299253cba55c62a7dd..6d77aeba868769d2ad299d69a64e6affa704d0bd 100644 (file)
@@ -15,7 +15,8 @@
   display: block;
   padding: $nav-link-padding-y $nav-link-padding-x;
 
-  @include hover-focus {
+  &:hover,
+  &:focus {
     text-decoration: none;
   }
 
@@ -42,7 +43,8 @@
     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;
     }
 
index 8f52bdd173419285382cd21cbcab5aaa360cd935..b1efa0c04abd406f30bfe00a5020ae74d0083bf3 100644 (file)
@@ -48,7 +48,8 @@
   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;
-      }
     }
   }
 }
index 67ecd9e275132caabe54157b5362713c1e925238..df3eacbff85e7ed32152daa2bdc7c6bf8bf5302c 100644 (file)
@@ -219,7 +219,7 @@ a {
   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;
   }
@@ -232,15 +232,11 @@ a {
 // 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;
   }
 }
index b7ab3d5062dd099ee02baf29522042905f670011..756c071a793074f529081983c645bb05cf998fd1 100644 (file)
@@ -84,7 +84,7 @@
 
 .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;
       }
index e2271491d5bc77a1972730f48747bb30f9c51d93..9d3f69c157911767f9b3e2aa90abd20b9427456f 100644 (file)
@@ -112,7 +112,6 @@ $enable-shadows:                              false !default;
 $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;
index 874f552d0ced3bb9eb4c303fdfd703eb9289e188..1c51765d2211f66a9f27472c96f52d5025e21786 100644 (file)
@@ -9,7 +9,7 @@
   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;
@@ -65,7 +65,7 @@
   color: $color;
   border-color: $color;
 
-  @include hover {
+  &:hover {
     color: $color-hover;
     background-color: $active-background;
     border-color: $active-border;
diff --git a/scss/mixins/_hover.scss b/scss/mixins/_hover.scss
deleted file mode 100644 (file)
index 192f847..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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;
-  }
-}
index cd47a4e9fa86d1468055d65fc88146e92bd073c7..965fc4bd87c6fe20e6fa1c9217437d30f47cef40 100644 (file)
@@ -6,7 +6,8 @@
     background-color: $background;
 
     &.list-group-item-action {
-      @include hover-focus {
+      &:hover,
+      &:focus {
         color: $color;
         background-color: darken($background, 5%);
       }
index f8d61869a482e169f0649934f285a838bacaed41..517229e1a7297e951e5070bc716ec5c875d3888a 100644 (file)
@@ -26,7 +26,7 @@
     $hover-background: darken($background, 5%);
 
     .table-#{$state} {
-      @include hover {
+      &:hover {
         background-color: $hover-background;
 
         > td,
index 155d6ca8cf2fca3281952aa3f114bb278ef377bd..4c68bae89e90079cd45ef6d1b8e18907d2fe5e4f 100644 (file)
@@ -8,7 +8,8 @@
   }
   @if $emphasized-link-hover-darken-percentage != 0 {
     a#{$parent} {
-      @include hover-focus {
+      &:hover,
+      &:focus {
         color: darken($color, $emphasized-link-hover-darken-percentage) !important;
       }
     }
index 278abd6cf2f35a54be25b4d20f23b5f4d86f770f..d06c3f703adf8857fe8a0b10eddbe37bfd49df87 100644 (file)
@@ -22,6 +22,7 @@ See the browser and devices page for details on what is currently supported in B
 
 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()`
index db971d114cb537f2a21a5909039038578620a35d..ab59339d0430ea82a11dc0af7582d2bc6f84de98 100644 (file)
@@ -6,7 +6,7 @@
   background-color: $bd-purple;
   outline: 0;
 
-  @include hover {
+  &:hover {
     color: $white;
   }
 }