Skip to content

Commit 78bff07

Browse files
patrickhlaukeffoodd
authored andcommitted
Tweak .visually-hidden to use display:inline-block instead of absolute positioning
1 parent 8f3d058 commit 78bff07

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

scss/mixins/_visually-hidden.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// See: https://kittygiraudel.com/2016/10/13/css-hide-and-seek/
77

88
@mixin visually-hidden() {
9+
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)
910
width: 1px !important;
1011
height: 1px !important;
1112
padding: 0 !important;
@@ -15,11 +16,6 @@
1516
white-space: nowrap !important;
1617
border: 0 !important;
1718

18-
// Fix for positioned table caption that could become anonymous cells
19-
&:not(caption) {
20-
position: absolute !important;
21-
}
22-
2319
// Fix to prevent overflowing children to become focusable
2420
* {
2521
overflow: hidden !important;

0 commit comments

Comments
 (0)