Skip to content

feat(cli): add contrast checker to panda studio - #2

Closed
Adebesin-Cell wants to merge 1 commit into
feat/cli-studio-cleanfrom
feat/cli-studio-contrast
Closed

feat(cli): add contrast checker to panda studio#2
Adebesin-Cell wants to merge 1 commit into
feat/cli-studio-cleanfrom
feat/cli-studio-contrast

Conversation

@Adebesin-Cell

@Adebesin-Cell Adebesin-Cell commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Stacked PR. Base is feat/cli-studio-clean (the studio PR, chakra-ui#3663), so this diff is just the contrast checker. Review chakra-ui#3663 first.

📝 Description

Add a contrast checker to panda studio. Pick two color tokens and see the WCAG contrast ratio with AA/AAA pass badges, so you can check a pairing without leaving the viewer.

⛳️ Current behavior (updates)

The studio viewer shows your colors, but there's no way to tell whether two of them meet contrast guidelines.

🚀 New behavior

A Contrast tool under the viewer's Playground nav. Two dropdowns pick the foreground and background from your color tokens; a live preview shows the pairing, the ratio (e.g. 4.52 : 1), and badges for AA, AA Large, AAA, and AAA Large.

Ratios are computed in the browser by rasterizing each color to a canvas pixel, so it handles any CSS color format your tokens use — including oklch, which the default preset emits.

💣 Is this a breaking change (Yes/No):

No.

📝 Additional Information

The studio stack:

Test plan:

  • pnpm --filter @pandacss/cli test
  • contrast math verified in the running viewer: #000/#fff → 21.00, oklch inputs rasterize correctly, badges flip at 3 / 4.5 / 7

@Adebesin-Cell

Adebesin-Cell commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Moved to upstream (stacked on the studio PR).

@Adebesin-Cell
Adebesin-Cell deleted the feat/cli-studio-contrast branch July 17, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant