Both, MediaWiki and OOUI feature a specific mixin, that is either part of a component or could be a helper class (non-semantic though) to add additional text exposed to screen readers/assistive technology (braille displays as second consumer) only.
// Screen Reader Helper Mixin .mixin-screen-reader-text() { display: block; position: absolute !important; /* stylelint-disable-line declaration-no-important */ clip: rect( 1px, 1px, 1px, 1px ); width: 1px; height: 1px; margin: -1px; border: 0; padding: 0; overflow: hidden; }
Similar OOUI
@AnneT has already provided this as part intermediate in https://github.com/wikimedia/wvui/pull/47/commits/8c9101002d057bb9fb893a17e28ae4bbf0052e72#diff-2490260dcd4dbf01664942433ca0a3c5L25, which was then removed from the patch later on.
We need to pick this up and add it.
Open questions
- .screen-reader-text() or .visually-hidden()
Staying with `.screen-reader-text
- Mixin or class
For componentizing and code modularization reasons we prefer mixins over classes