javascript icon indicating copy to clipboard operation
javascript copied to clipboard

ScreenReaderText component: audit che CSS rules

Open afercia opened this issue 6 years ago • 0 comments

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:

Screenshot 2019-05-31 at 11 40 19

afercia avatar May 31 '19 16:05 afercia