Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Announce whitespace in screen reader announcements of visually hidden text #960

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/components/tables/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@

@include mq($from: desktop) {
@include visually-shown(table-header-group); /* [2] */

&:before,
&:after {
content: "";
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions packages/core/tools/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
//

@mixin visually-hidden() {
// Absolute positioning has the unintended consequence of removing any
// whitespace surrounding visually hidden text from the accessibility tree.
// Insert a space character before and after visually hidden text to separate
// it from any visible text surrounding it.
frankieroberto marked this conversation as resolved.
Show resolved Hide resolved
&::before {
content: "\00a0";
}

&::after {
content: "\00a0";
}

border: 0;
clip: rect(0 0 0 0);
-webkit-clip-path: inset(50%);
Expand Down
Loading