Skip to content

Add runtime color utilities and contrast validation - #4297

Merged
Jason Morse (JasonVMo) merged 6 commits into
mainfrom
user/jasonvmo/issues-4268-4262
Sep 1, 2026
Merged

Add runtime color utilities and contrast validation#4297
Jason Morse (JasonVMo) merged 6 commits into
mainfrom
user/jasonvmo/issues-4268-4262

Conversation

@JasonVMo

Copy link
Copy Markdown
Contributor

Summary

  • add the opt-in @fluentui-react-native/design/color-lib runtime entry point for literal color parsing, sRGB/OKLCH conversion, alpha compositing, WCAG contrast ratios, and default or Bebop Warm hover/pressed generation
  • preserve authored interaction values and return structured diagnostics when native or dynamic React Native colors cannot be resolved in JavaScript
  • export WCAG policy, semantic pairings, structured audits, and result filters from the existing test-only @fluentui-react-native/design/testing entry point
  • keep pinned default and Bebop Warm conformance fixtures internal to package tests, with existing upstream contrast failures recorded explicitly
  • keep the production design root free of color-lib; measure only the runtime subpath and omit testing-only validation from bundle-size scenarios

Design alignment

The algorithms and conformance data were verified with the jasonmo_microsoft EMU identity against x3-design/fluent-design@d334acf5cbad813f2b7cd554da942b09a7ff8f10. Separate 118-value fixtures cover the default and Bebop Warm base themes across light/dark hover and pressed states.

Validation

  • design package format, lint, build, and Jest suites
  • root TypeScript build and no-cache Lage test suite
  • full Lage lint and Markdown link checks
  • repository structural, publishing, and changeset checks
  • macOS and Windows Metro bundle measurements for production scenarios

Fixes #4268
Fixes #4262

Comment thread packages/agentic/design/src/color-lib/parsing.ts Fixed
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Bundle size report

Tree-shaken production Metro bundles. Component costs are relative to their platform shell; shell costs are absolute.

Platform Scenario Baseline cost Current cost Cost delta Change Gzip delta Module delta
macos shell 801.3 KiB 801.3 KiB 0.0 KiB 0.00% 0.0 KiB +0
macos components-button 50.1 KiB 50.2 KiB +0.1 KiB +0.26% +0.0 KiB +2
macos components-catalog 267.3 KiB 273.3 KiB +6.0 KiB +2.24% +2.1 KiB +9
macos design-theme-state 33.3 KiB 33.4 KiB +0.1 KiB +0.40% +0.1 KiB +2
macos design-color-lib New 7.1 KiB New New New New
macos design-theme-state-legacy-source 35.3 KiB 35.5 KiB +0.1 KiB +0.38% +0.0 KiB +2
macos design-legacy-theme-from-flex 100.2 KiB 100.4 KiB +0.1 KiB +0.13% +0.1 KiB +2
windows shell 810.2 KiB 810.2 KiB 0.0 KiB 0.00% 0.0 KiB +0
windows components-button 50.0 KiB 50.1 KiB +0.1 KiB +0.26% +0.0 KiB +2
windows components-catalog 267.0 KiB 273.0 KiB +6.0 KiB +2.24% +2.1 KiB +9
windows design-theme-state 33.2 KiB 33.3 KiB +0.1 KiB +0.41% +0.1 KiB +2
windows design-color-lib New 7.1 KiB New New New New
windows design-theme-state-legacy-source 35.3 KiB 35.4 KiB +0.1 KiB +0.38% +0.0 KiB +2
windows design-legacy-theme-from-flex 100.0 KiB 100.1 KiB +0.1 KiB +0.13% +0.1 KiB +2

The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail.


View bundle-size workflow run

Jason Morse (JasonVMo) and others added 2 commits August 31, 2026 17:12
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JasonVMo
Jason Morse (JasonVMo) merged commit 0a6286c into main Sep 1, 2026
17 checks passed
@JasonVMo
Jason Morse (JasonVMo) deleted the user/jasonvmo/issues-4268-4262 branch September 1, 2026 19:18
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.

Theming: Runtime Color Utilities Theming: Contrast Audit Submodule

3 participants