]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Tweak `.visually-hidden` to use `display:inline-block` instead of absolute positioning
authorPatrick H. Lauke <redux@splintered.co.uk>
Sun, 18 May 2025 10:14:51 +0000 (11:14 +0100)
committerPatrick H. Lauke <redux@splintered.co.uk>
Sun, 18 May 2025 10:14:51 +0000 (11:14 +0100)
scss/mixins/_visually-hidden.scss

index 9dd0ad33bf8286cdf7f4074d90ada31f7c1041e4..c203cee204cb0ee68a75492dc598323131fac91a 100644 (file)
@@ -6,6 +6,7 @@
 // See: https://kittygiraudel.com/2016/10/13/css-hide-and-seek/
 
 @mixin visually-hidden() {
+  display: inline-block !important; // using this rather than position:absolute to allow for width/height/clip to work without causing undue spacing (e.g. in responsive tables)
   width: 1px !important;
   height: 1px !important;
   padding: 0 !important;
   white-space: nowrap !important;
   border: 0 !important;
 
-  // Fix for positioned table caption that could become anonymous cells
-  &:not(caption) {
-    position: absolute !important;
-  }
-
   // Fix to prevent overflowing children to become focusable
   * {
     overflow: hidden !important;