Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: code tab hover color in light mode (minor a11y issue) #291

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patricknelson
Copy link

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).

image

Before/after demo for you:

2025-01-05_17-23-41

Copy link

netlify bot commented Jan 6, 2025

Deploy Preview for custom-elements-manifest-analyzer ready!

Name Link
🔨 Latest commit e7dedfc
🔍 Latest deploy log https://app.netlify.com/sites/custom-elements-manifest-analyzer/deploys/677b30cdfb02be0008bd40dd
😎 Deploy Preview https://deploy-preview-291--custom-elements-manifest-analyzer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant