Repository navigation
fix(ui): restore text-contrast token - #48017
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughAdds a dedicated ChangesForeground contrast token
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
Restores the --foreground-contrast semantic token so text-contrast / text-foreground-contrast resolve to a surface-based inverse of --foreground (suitable for inverted fills), instead of incorrectly mapping to --primary-foreground after the color system rewrite.
Changes:
- Reintroduces
--foreground-contrastin the core semantic token set (semantic.css) as a surface-based value. - Removes the compat-layer remap that incorrectly aliased
--foreground-contrastto--primary-foreground. - Updates Tailwind theme token mappings (
--color-foreground-contrast,--text-color-contrast) to point at--foreground-contrast.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/ui/build/css/source/semantic.css | Defines --foreground-contrast as a surface-based inverse token for use on inverted fills. |
| packages/ui/build/css/source/compat.css | Removes the incorrect remap of --foreground-contrast to --primary-foreground in the compat layer. |
| packages/config/css/theme.css | Updates Tailwind theme variables to reference --foreground-contrast for contrast text utilities. |
fsansalvadore
left a comment
There was a problem hiding this comment.
Checked previews 👍
Braintrust eval report
|
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
text-contrast/text-foreground-contrastresolve to--primary-foreground, which is always the darker of surface / foreground lightness (text for the green primary fill).In light mode that is near-black, so contrast text on inverted fills is wrong: on true black (
bg-black) it disappears; on dark fills likebg-red-900it shows as a black icon instead of white. Visible regression on the design-system colour usage page: thetext-contrastswatch only shows "Postgres" on hover.Regression from the colour system rewrite (#47288), which aliased
--foreground-contrast→--primary-foreground.What is the new behavior?
--foreground-contrastis defined again as a surface-based inverse of--foreground(light in light mode, dark in dark mode). Tailwind utilitiestext-contrastandtext-foreground-contrastmap to it.--primary-foregroundis unchanged and still used for text on the primary fill.Additional context
Callsites to test (light mode especially)
text-contrastswatch shows "Postgres" without hoveringX) badge should be a white X (prod currently shows black)Announcement(text-foreground-contrastdismiss icon) is not currently mounted in any app — covered by the design-system / token check above.