spacelabdev / spacelab-react

5 stars 47 forks source link

Enhancement: Modify sr-only CSS class #446

Closed cindywongdev closed 10 months ago

cindywongdev commented 10 months ago

The current sr-only (screen reader only) class uses {display: none;}, which not only hides content visually, but also removes the content from the visual flow of the page, and is ignored by screen readers. Also, the sr-only class is defined twice in blogCarousel.scss, but it would make more sense for it to be a global style.

Please do the following:

  1. Overwrite the sr-only class using the following recommended styles for visually hiding content that will be read by a screen reader.

.sr-only { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; }

  1. Move the sr-only class to globalStyles.scss.

reference: https://webaim.org/techniques/css/invisiblecontent/