Skip to content

Tools

Contrast checker: APCA and WCAG 2

Type a text colour and a background, as hex or OKLCH, and the checker gives the APCA Lc, the WCAG 2 ratio and the smallest text the pair can carry under Meadowstack's thresholds. Further down, paste your colour tokens as CSS and it measures every text token on its backgrounds in each theme, the weakest pair first. Both tools run in your browser and send nothing anywhere.

By Bohuslav PoláčekChecked

Hex (#1d1d1f) or OKLCH (oklch(0.45 0 0))

Hex (#1d1d1f) or OKLCH (oklch(0.45 0 0))

APCA
Lc 87.2
WCAG 2
7.81:1
Carries
All text
It computes in your browser with the same code as the site's contrast tables (APCA-W3 0.0.98G-4g).

How to read the result

  • Lc: APCA's contrast. Light text on a dark background gives a negative number; its size is what counts.
  • Ratio: WCAG 2's, from 1:1 to 21:1.
  • Carries: the smallest text the pair is good for under decision 0014's thresholds: all text from Lc 75, text from 14px from Lc 60, text from 24px or from 16px at weight 550 from Lc 45, and no text below 4.5:1.

How the token pairs are chosen

The token check pairs tokens by their names, so the same CSS always gives the same pairs:

  • shadcn/ui's names: every X-foreground on X, and foreground and muted-foreground on background, card, popover and muted.
  • The kit's names: fg, fg-muted and fg-subtle on surface, canvas, frame and surface-subtle; every X-fg on X-subtle, or on X when there is no X-subtle; every X-contrast on X-solid; primary-fg on primary.
  • Tailwind's prefix: a leading color- is ignored when names are matched, so --color-primary-foreground pairs as well.

A pair the names cannot show, a link colour on a card for one, can be added by hand under the field.

What the token check reads

  • Blocks: :root and Tailwind's @theme are the light theme; .dark, [data-theme="dark"] or :root inside @media (prefers-color-scheme: dark) the dark one. A token the dark block leaves out keeps its light value, as it does in the browser.
  • Colours: hex, rgb(), hsl(), oklch(), shadcn/ui's bare HSL numbers and light-dark(), with every var() followed to its end.
  • Transparency: a translucent text colour is blended over its background, the way the browser draws it. A translucent background is skipped, because what shows through it is not in the CSS.
  • Skipped: a value it cannot read, such as color-mix() or lab(), is listed under its theme's table with the reason, and the pairs that need it are left out. Nothing is guessed.

What it does not check

Both tools read colours, not screens: the checker takes its two colours as opaque, and neither sees a picture or a gradient behind the text. A font's real weight and how the screen draws it change what people see too, so check the screen itself as well.

Check your colour tokens

Your globals.css, or just its :root and dark blocks. It reads hex, rgb(), hsl(), oklch(), shadcn/ui's bare HSL numbers and var().

Light theme

21 pairs: 3 carry no text under 14px.

Light theme: the pairs, the weakest first
PairText tokenBackgroundContrastAPCAWCAG 2Carries
fg-subtleon frameText from 14pxframeLc 72.55.12:15.12:1Text from 14px
fg-subtleon canvasText from 14pxcanvasLc 74.15.25:15.25:1Text from 14px
fg-subtleon surface-subtleText from 14pxsurface-subtleLc 74.55.28:15.28:1Text from 14px
danger-contraston danger-solidAll textdanger-solidLc −75.14.75:14.75:1All text
success-contraston success-solidAll textsuccess-solidLc −76.04.64:14.64:1All text
info-fgon info-subtleAll textinfo-subtleLc 76.56.29:16.29:1All text
danger-fgon danger-subtleAll textdanger-subtleLc 76.76.74:16.74:1All text
info-contraston info-solidAll textinfo-solidLc −76.84.79:14.79:1All text
warning-fgon warning-subtleAll textwarning-subtleLc 77.26.24:16.24:1All text
fg-subtleon surfaceAll textsurfaceLc 77.55.51:15.51:1All text
warning-contraston warning-solidAll textwarning-solidLc 78.111.14:111.14:1All text
success-fgon success-subtleAll textsuccess-subtleLc 81.27.36:17.36:1All text
fg-mutedon frameAll textframeLc 82.07.23:17.23:1All text
fg-mutedon canvasAll textcanvasLc 83.67.40:17.40:1All text
fg-mutedon surface-subtleAll textsurface-subtleLc 84.07.44:17.44:1All text
fg-mutedon surfaceAll textsurfaceLc 87.07.77:17.77:1All text
fgon frameAll textframeLc 98.615.51:115.51:1All text
fgon canvasAll textcanvasLc 100.215.88:115.88:1All text
fgon surface-subtleAll textsurface-subtleLc 100.615.97:115.97:1All text
fgon surfaceAll textsurfaceLc 103.616.67:116.67:1All text
primary-fgon primaryAll textprimaryLc −103.816.20:116.20:1All text

Dark theme

21 pairs: 4 carry no text under 14px.

Dark theme: the pairs, the weakest first
PairText tokenBackgroundContrastAPCAWCAG 2Carries
fg-subtleon surfaceText from 14pxsurfaceLc −62.99.31:19.31:1Text from 14px
fg-subtleon surface-subtleText from 14pxsurface-subtleLc −63.29.55:19.55:1Text from 14px
fg-subtleon canvasText from 14pxcanvasLc −63.39.76:19.76:1Text from 14px
fg-subtleon frameText from 14pxframeLc −63.510.05:110.05:1Text from 14px
danger-contraston danger-solidAll textdanger-solidLc −75.14.72:14.72:1All text
danger-fgon danger-subtleAll textdanger-subtleLc −75.29.99:19.99:1All text
success-fgon success-subtleAll textsuccess-subtleLc −76.010.07:110.07:1All text
info-contraston info-solidAll textinfo-solidLc 76.111.78:111.78:1All text
info-fgon info-subtleAll textinfo-subtleLc −76.410.02:110.02:1All text
warning-fgon warning-subtleAll textwarning-subtleLc −76.59.82:19.82:1All text
warning-contraston warning-solidAll textwarning-solidLc 76.811.24:111.24:1All text
success-contraston success-solidAll textsuccess-solidLc 77.412.00:112.00:1All text
fg-mutedon surfaceAll textsurfaceLc −77.912.18:112.18:1All text
fg-mutedon surface-subtleAll textsurface-subtleLc −78.112.49:112.49:1All text
fg-mutedon canvasAll textcanvasLc −78.312.77:112.77:1All text
fg-mutedon frameAll textframeLc −78.513.14:113.14:1All text
primary-fgon primaryAll textprimaryLc 94.315.87:115.87:1All text
fgon surfaceAll textsurfaceLc −95.315.87:115.87:1All text
fgon surface-subtleAll textsurface-subtleLc −95.516.28:116.28:1All text
fgon canvasAll textcanvasLc −95.716.64:116.64:1All text
fgon frameAll textframeLc −95.817.13:117.13:1All text
Every text token on its backgrounds in each theme, the weakest first, starting with Meadowstack's own semantic colours and computed with the checker's code.

Sources

Questions

Which colour formats does it read?

The checker reads hex, as #RGB or #RRGGBB, and CSS oklch(), the format the kit's colour tokens are written in. The token check also reads rgb(), hsl(), shadcn/ui's bare HSL numbers and var().

Why does it show two numbers?

WCAG 2.2's ratio is what most audits still test against, and APCA's Lc is read against the size and weight of the text. Meadowstack's rule needs both: the Lc for the text size, and never less than 4.5:1.

Can I paste shadcn/ui's globals.css?

Yes, in both its forms: the older one with bare HSL numbers inside @layer base, and the Tailwind 4 one with oklch() and @theme inline, whose --color- lines only point back at the tokens. Every foreground token is measured on its background in the light and the dark theme.

Why is a pair missing or skipped?

Pairs come from the token names, so a token named outside shadcn/ui's or the kit's patterns pairs with nothing until you add it by hand. A token is skipped when its value does not come out as one flat colour, such as color-mix(), a var() that points nowhere or a translucent background, and the list under each table says which and why.

Is anything sent to a server?

No. Both tools are scripts on this page; the colours and the CSS you paste never leave your browser.

Two ways

Build it yourself, or have it built

  • Build it yourself

    Build your app on the framework

    Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.

    One payment, lifetime updates

    Get the framework
  • Have it built

    Have us build your app

    Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.

    After launch, Care keeps it improving, from €99 a month.

    from €1,990

    Describe your app