Skip to content

feat: add gray40 and gray50 variables#780

Merged
huyenltnguyen merged 1 commit into
freeCodeCamp:mainfrom
huyenltnguyen:feat/add-gray-variables
May 30, 2026
Merged

feat: add gray40 and gray50 variables#780
huyenltnguyen merged 1 commit into
freeCodeCamp:mainfrom
huyenltnguyen:feat/add-gray-variables

Conversation

@huyenltnguyen
Copy link
Copy Markdown
Member

@huyenltnguyen huyenltnguyen commented May 30, 2026

Checklist:

Currently we default to gray45 for muted/disabled text. However, it does not provide sufficient contrast against our background colors. The only case where this is acceptable is for disabled elements, but there are recent use cases where the color is used for non-disabled content as well.

This PR introduces two new gray variables for muted text:

  • Light theme will use gray50
  • Dark theme will use gray40

These colors meet the contrast ratio requirements against primary, secondary, and tertiary background colors. Quaternary backgrounds are not included, as I haven't seen muted/disabled text used on them.

Contrast ratio

Light theme

primary bg (#ffffff) secondary bg (#f5f6f7) tertiary bg (#dfdfe2)
gray45 (#858591) ❌ 3.64:1 ❌ 3.36:1 ❌ 2.74:1
gray50 (#626262) ✅ 6.09:1 ✅ 5.63:1 ✅ 4.58:1

Dark theme

primary bg (#0a0a23) secondary bg (#1b1b32) tertiary bg (#2a2a40)
gray45 (#858591) ✅ 5.33:1 ✅ 4.61:1 ❌ 3.83:1
gray40 (#939393) ✅ 6.32:1 ✅ 5.47:1 ✅ 4.54:1

@huyenltnguyen huyenltnguyen marked this pull request as ready for review May 30, 2026 22:04
@huyenltnguyen huyenltnguyen requested a review from a team as a code owner May 30, 2026 22:04
@huyenltnguyen huyenltnguyen merged commit f655198 into freeCodeCamp:main May 30, 2026
7 checks passed
@huyenltnguyen huyenltnguyen deleted the feat/add-gray-variables branch May 30, 2026 22:07
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