Accessibility: add screen-reader-text styles - #107
shail-mehta wants to merge 4 commits into
Conversation
Stylelint requires overflow-wrap, and Unix line endings keep the stylesheet diff to the new rules.
Restore the existing stylesheet formatting so the pull request no longer rewrites both files.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
@shail-mehta WordPress core already outputs the CSS for the screen-reader-text class for block themes. That is why the theme did not include it. |
|
Thanks @carolinan - you're right. Core already provides |
Description
Part of #44 - Screen reader text supported
What
Adds the required
.screen-reader-textCSS so text can be hidden visually while remaining available to assistive technologies. Styles land instyle.css(front end) andassets/css/editor-style.css(editor canvas).Why
Accessibility-ready themes must ship a documented, properly styled screen-reader text class that authors can apply via Additional CSS Class(es) without writing custom CSS (guideline, required CSS). Ipsum patterns already use
.screen-reader-text(e.g. the Posts heading on the index), but the theme did not define the class.How
clip-path: inset(50%)and the standard 1px absolutely positioned box (nodisplay: none/visibility: hidden).:focus, reveal focusable screen-reader text (skip links) using palette tokens (theme-1/theme-6) so the chip stays readable across color variations.Screenshots
Content with the class should be visually hidden; optional: before/after of a heading with
screen-reader-textapplied.Testing Instructions
screen-reader-text.clip-path, 1px size, etc.), notdisplay: noneorvisibility: hidden.Use of AI Tools
Cursor