fix: add neutral to accentColorIds in prehydration#1797
fix: add neutral to accentColorIds in prehydration#1797serhalp merged 1 commit intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
0d81b5d to
104f161
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request modifies the accent colour ID validation set in Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
serhalp
left a comment
There was a problem hiding this comment.
Thanks for fixing!
(💭 I think this has regressed a couple times, so we're probably due for an integration or e2e test of some sort.)
|
Thanks for your first contribution, @maxchang3! 💫 We'd love to welcome you to the npmx community. Come and say hi on Discord! And once you've joined, visit npmx.wamellow.com to claim the contributor role. |
This is what I came up with, though I wasn't sure about a better approach. Maybe worth trying in-source testing to directly access Another approach that comes to mind is using // I randomly copied `UnionToTuple` from https://github.com/type-challenges/type-challenges/issues/737,
// A simpler alternative is to export an `ACCENT_COLOR_IDS` array as a `const`.
// Valid accent color IDs (must match --swatch-* variables defined in main.css)
const accentColorIds = new Set([
'sky',
'coral',
'amber',
'emerald',
'violet',
'magenta',
'neutral',
] as const satisfies UnionToTuple<AccentColorId>) |
🔗 Linked issue
Fixes #1792
🧭 Context
neutralwas missing fromaccentColorIds, so thehas()check skipped it on page load, and--accent-colorwas not applied, falling back to the CSS default.📚 Description
neutraltoaccentColorIdsACCENT_COLORSA better way to enforce exhaustiveness of
accentColorIdsagainstAccentColorIdmay be worth exploring.