fix: code tab hover color in light mode (minor a11y issue) #291
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.
When hovering over a
<code-tabs>
button while in light mode, the hover state flips from the primary text color, which is nearly black (#2c3e50) on a light gray, to white, which isn't visible on the light background. This is due to the failover which is currently being used since--code-button-focus-color
is currently undefined. Since there's a light/dark theme here and it seems like the inherited text color is already used, I just set the current color to 75% opacity (which was what was already happening, particularly on the dark theme). So, no visible change for dark, just apply the same change for white.Note: I'm using
color-mix()
here but support for it is very good and growing (~92% which is pretty decent). See: https://caniuse.com/mdn-css_types_color_color-mix. Not to mention it's more of a focus/hover state which won't affect touch devices so much (where the bulk of support is lacking, older Safari versions).Before/after demo for you: