From 973276108ddac31d6996cdf19d1a9b2839269da6 Mon Sep 17 00:00:00 2001 From: Hans Hillen Date: Tue, 7 Jan 2025 19:23:43 +1300 Subject: [PATCH] Fix: aria-label class not properly hidden (fixes #606) --- less/core/accessibility.less | 37 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/less/core/accessibility.less b/less/core/accessibility.less index 7506ce97..ac151951 100644 --- a/less/core/accessibility.less +++ b/less/core/accessibility.less @@ -3,33 +3,28 @@ .component { position: relative; } .block { position: relative; } -// jquery.a11y start -// Invisible aria-labels -// -------------------------------------------------- -.aria-label { +.aria-label, .visually-hidden { + display: block; position: absolute !important; - &.relative { - position: relative !important; - } - left: 0 !important; - width: auto !important; - height: auto !important; - overflow: auto !important; - color: rgba(0,0,0,0) !important; - background: rgba(0,0,0,0) !important; - font-size: 1px !important; + width: 1px !important; + height: 1px !important; padding: 0 !important; - margin: 0 !important; - line-height: normal !important; - z-index: 1; + margin: -1px !important; + overflow: hidden !important; + clip: rect(0, 0, 0, 0) !important; + white-space: nowrap !important; + border: 0 !important; + display: none !important; } -// Force aria-labels to hide on hidden -// -------------------------------------------------- -.aria-label.aria-hidden { - display: none !important; +.aria-label-focusable, .visually-hidden-focusable { + &:not(:focus):not(:focus-within) { + .visually-hidden + } } +// jquery.a11y start + // Hidden focus guard // -------------------------------------------------- .a11y-focusguard {