Skip to content

Split feedback colors into text and decoration tokens (#802) - #807

Draft
adamkudrna wants to merge 1 commit into
feature/801-state-text-colorsfrom
feature/802-feedback-text-colors
Draft

adamkudrna wants to merge 1 commit into
feature/801-state-text-colorsfrom
feature/802-feedback-text-colors

Conversation

@adamkudrna

Copy link
Copy Markdown
Member

Text needs 4.5:1 contrast, while borders and fills need only 3:1. Feedback colors get separate text tokens, so a theme can darken text without darkening decorations. The default theme looks the same.

Stacked on the pull request for #801. Retarget to master after it merges.

Changes

  • Add --rui-color-feedback-<color>-text, -text-hover and -text-active, which default to the existing colors.
  • Use them for the Alert foreground, outline Badge text, flat and outline Button text, links in Alert and Card, and the text-<color> utilities.
  • Keep borders and filled backgrounds on the existing tokens.
  • Document the text tokens in Foundation › Colors.

Review notes

  • A darker -text token also darkens the Alert border and stripe and the outline Badge border, which follow the text color.
  • Nit: overriding only -text leaves -text-hover and -text-active on the decoration shades.
  • Nit: -text* aliases resolve on :root, so overriding a feedback color on a subtree no longer recolors the text-<color> utilities and links in Alert and Card.
  • Pre-existing (follow-up): the Alert README says foreground-color covers links, but they follow the global feedback tokens.

Closes #802

Text needs 4.5:1 contrast, while borders and fills need only 3:1. Add
`--rui-color-feedback-<color>-text`, `-text-hover` and `-text-active`,
which default to the existing colors.

Use them for the `Alert` foreground, outline `Badge` text, flat and
outline `Button` text, links in `Alert` and `Card`, and the
`text-<color>` utilities. Borders and filled backgrounds keep using the
existing tokens.
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2

QR code for preview link

🚀 View preview at
https://react-ui-org.github.io/react-ui/pr-preview/pr-807/

Built to branch gh-pages at 2026-11-30 18:58 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch was successfully deployed

1 active deployment
pr-preview/pr-807 — e868dd60 Deployed Nov 30, 2026 by adamkudrna via Deploy PR Preview #199
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant