Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(Kbd): use primary text color token to meet WCAG AA contrast (#7100)

Geervan8b0879da2374
diff --git a/.changeset/kbd-text-contrast-wcag-aa.md b/.changeset/kbd-text-contrast-wcag-aa.md
new file mode 100644
index 0000000000..c7951ea389
--- /dev/null
+++ b/.changeset/kbd-text-contrast-wcag-aa.md
@@ -0,0 +1,9 @@
+---
+'@astryxdesign/core': patch
+---
+
+[fix] Kbd: use primary text color token to meet WCAG AA contrast over neutral keycaps
+
+The default `<kbd>` text color has been updated to `--color-text-primary`, ensuring visible key glyphs exceed the 4.5:1 WCAG AA contrast ratio against the `--color-neutral` keycap background across all light and dark themes.
+
+@Geervan
diff --git a/packages/core/src/Kbd/Kbd.tsx b/packages/core/src/Kbd/Kbd.tsx
index 2a751e09d3..bc62269ea5 100644
--- a/packages/core/src/Kbd/Kbd.tsx
+++ b/packages/core/src/Kbd/Kbd.tsx
@@ -47,7 +47,7 @@ const styles = stylex.create({
borderBottomWidth: '2px',
borderBottomStyle: 'solid',
borderBottomColor: colorVars['--color-border-emphasized'],
- color: colorVars['--color-text-secondary'],
+ color: colorVars['--color-text-primary'],
fontFamily: typographyVars['--font-family-body'],
fontSize: typeScaleVars['--text-supporting-size'],
fontWeight: fontWeightVars['--font-weight-medium'],