update indicator style to have visibility:hidden for screen readers #3361
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Updating indicator inline style tag so that it uses visibility:hidden as well as opacity so that screen readers will not announce the invisible indicators to users to improve default accessibility
Note I found the current indicator only does a fade in when it shows and does a instant vanish after the request which has been this way for 2 years since a bug was fixed to prevent the indicators fade out showing briefly on hx-location page loads. I kept the same behavior but just added visibility.
Also I found there was a lot of wasted white space being added in the old code which impacted minification so resolved this and optimized the duplicate class config variable use with const's.
Also updated the hx-indicator documentation to match the new default style and improved the documentation around how to disable and work around inline style with CSP headers.
Corresponding issue:
#3354
Testing
Tested manually to confirm the updated style worked as before for fade in during requests and ran the test suite. Also inspected the impact on the minified and gz size to make sure it is smaller than the old one
Checklist
master
for website changes,dev
forsource changes)
approved via an issue
npm run test
) and verified that it succeeded