Skip to content

Commit 4f91e37

Browse files
JeffersonBledsoeichim-davidWagner3UBstevepiercy
authored
Added visually-hidden class (#6356)
Co-authored-by: Ichim David <[email protected]> Co-authored-by: Wagner Trezub <[email protected]> Co-authored-by: Wagner Trezub <[email protected]> Co-authored-by: Steve Piercy <[email protected]>
1 parent b871c12 commit 4f91e37

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

docs/source/contributing/accessibility-guidelines.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ The reasoning is that the `<a></a>` HTML tag has specific behavior that screenre
3939
## Make sure form elements have a label
4040

4141
This is true for one-element forms as well, such as the "Search" form on the folder-contents component. Putting an icon on it does not convey any meaning to screenreader-users, you should clarify it with an aria-label.
42+
43+
## Additional information for non-visual users
44+
45+
Sometimes extra information needs to be provided to users who are not able to see the screen.
46+
The `.visually-hidden` class can be used to wrap elements which need to be exposed to assistive technologies, such as screen readers, without them being visible.

docs/source/upgrade-guide/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,23 @@ If you can't upgrade immediately, you may continue to run Volto 19 on Node.js 20
5050

5151
(19-removed-support-for-loading-configuration-from-project-label)=
5252

53+
### New utility class `visually-hidden`
54+
55+
```{versionadded} Volto 19.0.0-alpha.10
56+
```
57+
58+
A new global CSS utility class called `visually-hidden` [`@packages/components/src/styles/basic/utility.css`] has been introduced to Volto's SCSS base.
59+
60+
This class allows developers to visually hide elements while keeping them accessible to screen readers, improving accessibility for assistive technologies.
61+
62+
If your project, add-on, or custom theme already defines a `visually-hidden` class, or uses similar accessibility helpers, the new global definition may override or conflict with existing custom styles.
63+
In which case, you should rename your custom implementation, or override Volto's default, as needed.
64+
Also review any components that depend on hidden accessibility elements to ensure visual and functional consistency.
65+
66+
```{seealso}
67+
[Add visually-hidden class #6356](https://github.com/plone/volto/pull/6356)
68+
```
69+
5370
### Removed support for loading configuration from project
5471
```{versionremoved} Volto 19
5572
```

packages/volto/news/6356.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `visually-hidden` utility CSS class that integrators and core developers can use. @JeffersonBledsoe @Wagner3UB

packages/volto/theme/themes/pastanaga/extras/utils.less

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,16 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
6161
}
6262
}
6363
}
64+
65+
.visually-hidden {
66+
position: 'absolute';
67+
overflow: 'hidden';
68+
width: '1px';
69+
height: '1px';
70+
padding: 0;
71+
border: 0;
72+
margin: '-1px';
73+
clip: 'rect(1px 1px 1px 1px)'; // IE-style CSS for compatibility
74+
white-space: 'nowrap';
75+
word-wrap: 'normal';
76+
}

0 commit comments

Comments
 (0)