Skip to content

docs(scss): improve color-contrast function documentation#42055

Open
njg7194 wants to merge 1 commit intotwbs:mainfrom
njg7194:docs/improve-color-contrast-documentation
Open

docs(scss): improve color-contrast function documentation#42055
njg7194 wants to merge 1 commit intotwbs:mainfrom
njg7194:docs/improve-color-contrast-documentation

Conversation

@njg7194
Copy link

@njg7194 njg7194 commented Feb 1, 2026

Summary

Improved documentation for the color-contrast(), contrast-ratio(), and luminance() functions in _functions.scss.

Changes

Added WCAG 2.2 Reference

  • Added explanation of WCAG contrast requirements
  • Included links to official WCAG guidelines
  • Documented contrast level thresholds (AA vs AAA)

Added SassDoc-style Function Documentation

  • @param descriptions for all function parameters
  • @return type documentation
  • Clear explanation of function behavior

Motivation

The color contrast functions are critical for accessibility compliance, but the existing documentation did not explain the WCAG requirements or how the $min-contrast-ratio parameter relates to accessibility levels.

This additional documentation helps developers:

  1. Understand what contrast ratios are required for WCAG compliance
  2. Choose appropriate values for their accessibility targets
  3. Know when 4.5:1 vs 3:1 ratios are acceptable

WCAG Reference

  • Level AA (minimum): 4.5:1 for normal text, 3:1 for large text
  • Level AAA (enhanced): 7:1 for normal text, 4.5:1 for large text

See: https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html

Added comprehensive documentation for the color contrast functions:
- Explained WCAG 2.2 contrast requirements
- Added contrast level reference (AA vs AAA)
- Documented function parameters with SassDoc-style comments
- Added links to WCAG guidelines

This helps developers understand the accessibility implications
of the contrast calculations and choose appropriate values.
@njg7194 njg7194 requested a review from a team as a code owner February 1, 2026 04:21
@github-project-automation github-project-automation bot moved this to Needs review in v5.4.0 Feb 1, 2026
@julien-deramond julien-deramond moved this from Needs review to To analyze in v5.4.0 Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: To analyze

Development

Successfully merging this pull request may close these issues.

2 participants