Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/fix-pagination-dots-contrast.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[fix] Pagination (dots variant): inactive dots now use `--color-text-secondary` instead of the translucent `--color-neutral`, meeting WCAG 1.4.11 non-text contrast (3:1) on body/surface. The active dot now renders as an outlined ring (inset accent ring with transparent fill) rather than a solid fill, so the current page is identifiable by shape and not only by color, addressing WCAG 1.4.1 Use of Color.

@gonzoblasco
13 changes: 10 additions & 3 deletions packages/core/src/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,12 @@ const styles = stylex.create({
borderStyle: 'none',
padding: 0,
borderRadius: '50%',
backgroundColor: colorVars['--color-neutral'],
// Use a solid secondary text token instead of the translucent --color-neutral
// so inactive dots meet WCAG 1.4.11 (3:1 non-text contrast) on body/surface.
// --color-neutral is 20% alpha and blends to ~1.2:1 (light) / ~1.7:1 (dark).
backgroundColor: colorVars['--color-text-secondary'],
cursor: 'pointer',
transitionProperty: 'background-color',
transitionProperty: 'background-color, box-shadow',
transitionDuration: durationVars['--duration-fast'],
transitionTimingFunction: easeVars['--ease-standard'],
outline: {
Expand All @@ -202,7 +205,11 @@ const styles = stylex.create({
height: spacingVars['--spacing-1-5'],
},
dotActive: {
backgroundColor: colorVars['--color-accent'],
// Render the active dot as an outlined ring rather than a solid fill so the
// current page is identifiable by shape, not only by color (WCAG 1.4.1 Use
// of Color). The inset ring adds no size, so the dot layout is unchanged.
backgroundColor: 'transparent',
boxShadow: `inset 0 0 0 2px ${colorVars['--color-accent']}`,
},
dotDisabled: {
cursor: 'not-allowed',
Expand Down