Skip to content

fix: default to system accent color on invalid user color #47660

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

Merged
merged 1 commit into from
Jul 8, 2025

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Jul 3, 2025

Description of Change

Fixes an issue where an invalid color passed as a string to accentColor would result in a white accent color. This happened because our ParseCSSColor utility falls back to white on parse failure. When a user passes an invalid string we should instead fall back to system color.

This fixes that by reworking our ParseCSSColor utility to return an optional value and leaving it up to the callers to decide their fallback color.

cc @bpasero

Checklist

Release Notes

Notes: Fixes an issue where an invalid color passed as a string to accentColor would result in a white accent color.

@codebytere codebytere requested review from ckerr and deepak1556 July 3, 2025 18:36
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Jul 3, 2025
@electron-cation electron-cation bot added new-pr 🌱 PR opened recently and removed new-pr 🌱 PR opened recently labels Jul 3, 2025
@codebytere codebytere force-pushed the default-undefined-on-failed branch from 89a68f8 to fe68bfe Compare July 7, 2025 12:01
@codebytere codebytere requested a review from deepak1556 July 7, 2025 12:01
@codebytere codebytere merged commit 31bc5ca into main Jul 8, 2025
56 of 57 checks passed
@codebytere codebytere deleted the default-undefined-on-failed branch July 8, 2025 09:15
@release-clerk
Copy link

release-clerk bot commented Jul 8, 2025

Release Notes Persisted

Fixes an issue where an invalid color passed as a string to accentColor would result in a white accent color.

@trop
Copy link
Contributor

trop bot commented Jul 8, 2025

I was unable to backport this PR to "36-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Jul 8, 2025

I was unable to backport this PR to "37-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot added needs-manual-bp/36-x-y and removed target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. labels Jul 8, 2025
@trop
Copy link
Contributor

trop bot commented Jul 8, 2025

I have automatically backported this PR to "38-x-y", please check out #47684

@trop trop bot added in-flight/38-x-y merged/38-x-y PR was merged to the "38-x-y" branch. and removed target/38-x-y PR should also be added to the "38-x-y" branch. in-flight/38-x-y labels Jul 8, 2025
codebytere added a commit that referenced this pull request Jul 11, 2025
fix: default to system accent color on invalid user color"
@trop
Copy link
Contributor

trop bot commented Jul 17, 2025

@codebytere has manually backported this PR to "37-x-y", please check out #47800

@trop trop bot added merged/37-x-y PR was merged to the "37-x-y" branch. and removed in-flight/37-x-y labels Jul 31, 2025
@trop trop bot added in-flight/36-x-y merged/36-x-y PR was merged to the "36-x-y" branch. and removed in-flight/36-x-y needs-manual-bp/36-x-y labels Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/36-x-y PR was merged to the "36-x-y" branch. merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants