Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
the readme claims "Accessible, consistent focus outlines."
this is actually not true, as different browsers have a different idea of what
Highlightentails. moreover, even within browsers that do have a consistent idea ofHighlight, they will not be perfect alone if the background doesn't have enough contrast.a dual
Canvas+CanvasTextfocus indicator works more consistently and has a better chance of being always accessible. it will always adapt to thecolor-scheme(lightordark) and will also have maximum contrast. basically the 3pxCanvasTextoutline is surrounded by a 1pxCanvasshadow on both sides, avoiding contrast issues with the element's background or the page background.combined, these styles should pass WCAG SC 1.4.11, 2.4.7, 2.4.12, 2.4.13 in most cases
i initially didn't want to use
box-shadowbecause many elements bring their own box-shadow. but with the current appraoch, theoutlineis always present, so we have a "fallback" of sorts, even if thebox-shadowgets removed by the developer or in forced-colors.