-
Notifications
You must be signed in to change notification settings - Fork 1
fix: automatic On Color recalculation in dark mode and add Copilot instructions #1244
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
base: main
Are you sure you want to change the base?
Conversation
|
@mfranzke 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: mfranzke <[email protected]>
Co-authored-by: mfranzke <[email protected]>
|
@copilot please retry |
Co-authored-by: mfranzke <[email protected]>
I've created comprehensive Copilot instructions for the theme builder repository in The instructions include details about:
Commit: 547f900 |
This PR addresses the issue where the "On Color" (text color) was not automatically recalculated when changing origin colors in the Theme Builder, requiring users to manually delete and recalculate the On Color value.
Problem
When users changed origin colors in either light or dark mode, the corresponding on-origin colors (text colors) were not automatically updated to maintain proper contrast ratios. This created accessibility issues and poor user experience.
Solution
Modified the
onColorChangehandlers incolor-picker.tsxto automatically extract and apply the calculatedonOriginDarkDefaultandonOriginLightDefaultvalues from thegenerateColorsByOriginfunction whenever origin colors change.Visual Comparison
Before Fix (poor contrast with manual intervention required):

After Fix (excellent contrast with automatic recalculation):

Testing Results
Additional Improvements
Added comprehensive Copilot instructions (
.github/copilot-instructions.md) covering:The fix ensures WCAG compliance and eliminates the need for manual on-color recalculation, providing a seamless user experience when customizing themes.
Fixes #1236.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.