-
Notifications
You must be signed in to change notification settings - Fork 101
High contrast conditional classes #2127
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
Conversation
|
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for stacks-svelte ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
dancormier
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @chris-doucette-stack 🫶 The code changes all look pretty solid.
I'd like to understand the use case that motivated this change before merging it in. I haven't checked but this has the potential to increase the Stacks Classic bundle size a good amount and I've avoided adding this personally in the hopes that Stacks components and careful design should negate the need for any high contrast mode color overrides.
If the use case justifies this change, I'm happy to merge it in but I'm also glad to brainstorm with you a bit to figure out if there's another way that avoids increasing the bundle size. Let me know what you think!
|
Hi @dancormier, thanks for the review! |
@chris-doucette-stack oh! Yeah, I see it only hits 6.74:1. I believe all stops with a difference of 300 or more should meet or exceed 7:1 in HC mode, so this I'd consider this to be a bug. Can you confirm @CGuindon? If so, I can go ahead update values as necessary once they're available. |
|
Yes, we can nudge the black-400 color in HC mode so that it passes 7:1 on a background of black-100 (we'll have other cases of that across the product). Leave the text as black-400 in the inbox. |
|
Here are some updated colors #2140 |
|
@dancormier Did you mean to merge this? It looked like we addressed this through a different approach, I also never added a changeset. |
|
Yes we reverted the PR, thanks for the warning |
Summary
This PR adds the ability to apply conditional font color and background color classes to high contrast themes.
How to test
I added a section for it to our conditional classes docs, you can see it in action there by:
theme-highcontrastto the documents body (you may want to edit the DOM and change the class fromhc:fc-black-600to something likehc:fc-red-600it pops out more visually)