Skip to content

Conversation

@Mitch-At-Work
Copy link
Contributor

@Mitch-At-Work Mitch-At-Work commented Apr 14, 2025

Previous Behavior

Components relied on fluentui/tokens package which used generic level tokens for all components
fluentui/tokens was exported as a singular object, causing larger bundle sizes in ESBuild based projects

New Behavior

Components can now opt in to semantic style hooks via fluentui/semantic-style-hooks and fluentui/semantic-tokens package which:

  • Enables semantic token specificity (Elevates fluent to the global Microsoft horizontal token definition).
  • Provides token fallbacks to generic layers for minimal token definitions and theme definitions
  • Is backwards compatible with existing token definitions, there should be no visual regressions when using existing token sets (original legacy tokens are the final fallback if no semantic tokens present)
  • Provide additional tokens for use outside of fluent components, in a tree shakable manner
  • Internally using flat exported versions of fluentui/tokens to ensure no increased bundle size when using ESBuild
  • Move updated semantic styles to useStyle custom hooks so that semantic tokens are opt-in
  • Move semantic-tokens to pre-release versioning (0.x.y)

ToDo (Post merge/preview release)

  • Visual regression tests (For now, compared against master/legacy styles to ensure backwards compatibility).
  • Storybook-addon: Enable opt-in to semantic tokens, inject via withFluentProvider, and enable example kumo theme via it's own @fluentui/semantic-theme package
  • Semantic-tokens grouping update: Provide more fidelity/documentation around semantic token grouping, will extend/be backwards compatible with current tokens
  • Finalize and add blocked components for full component coverage (Currently awaiting designs and token updates).

@github-actions
Copy link

github-actions bot commented Apr 28, 2025

📊 Bundle size report

✅ No changes found

@github-actions
Copy link

Pull request demo site: URL

@Mitch-At-Work
Copy link
Contributor Author

Moved core changes (nessecary exports) to #35007

rachethecreator and others added 23 commits August 19, 2025 15:34
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Co-authored-by: terynkum <terynkum@microsoft.com>
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Force merging as it is a simple rebase resolution in feature branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants