-
Notifications
You must be signed in to change notification settings - Fork 519
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 IssueLabelToken
treating alternative light schemes as dark
#3104
Fix IssueLabelToken
treating alternative light schemes as dark
#3104
Conversation
🦋 Changeset detectedLatest commit: 6390d9f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 quick fix ⚡
size-limit report 📦
|
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! 🚀 Just missing a changeset.
…hich is not guaranteed to be accurate
The
IssueLabelToken
conditionally picks colors based on whethercolorScheme === 'light'
. This strategy assumes that there exist only two color schemes, when in reality there are many.The fix for this is to useresolvedColorMode
, which has four possible values:dark
,night
,light
, andday
(it's not clear what the difference betweendark
andnight
orlight
andday
are, but this is what the value is typed as). So instead, to accurately determine whether the color scheme is a light one, we can see ifresolvedColorMode
islight
orday
.Update: instead of using
resolvedColorMode
we decided to useresolvedColorTheme
and see if itstartsWith
the expected color mode. This is less robust to new theme name formats but somewhat safer because there is no guarantee that the color mode actually matches the theme in real life, and the theme is what really determines the colors that are rendered.Alternatively, we could instead call
colorScheme.includes('light')
, but I avoided this solution because it feels fragile (not robust to the possibility of future themes that are named differently.Closes #3098
Before:
After: