javascript
javascript copied to clipboard
ScreenReaderText component: audit che CSS rules
Explanation
The ScreenReaderText component uses its own inline style via packages/components/src/a11y/Styles.js.
At the same time, it has screen-reader-text a CSS class.
In the WordPress context, this means it will get two set of rules that are redundant.
Also, the rule from Styles.js is out of date: core provides an updated rule.
If I remember correctly, the doubled styles were an accepted compromise to take into account scenarios were the ScreenReaderText is used outside of WordPress. We should double check this.
In any case, the rule from Styles.js needs to be updated to match the one from core.
Screenshot: