fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Feat: Semantic Tokens

Open Mitch-At-Work opened this issue 8 months ago • 2 comments

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 now rely on fluentui/semantic-tokens package which:

  • Enables component level token specificity
  • Provides token fallbacks to generic layer for minimal token definitions
  • Is backwards compatible with existing token definitions, there should be no visual regressions when using existing token sets
  • 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

ToDo

  • Move updated semantic styles to useStyle custom hooks so that semantic tokens are opt-in

Mitch-At-Work avatar Apr 14 '25 17:04 Mitch-At-Work

📊 Bundle size report

✅ No changes found

github-actions[bot] avatar Apr 28 '25 16:04 github-actions[bot]

Pull request demo site: URL

github-actions[bot] avatar Apr 28 '25 17:04 github-actions[bot]

Moved core changes (nessecary exports) to https://github.com/microsoft/fluentui/pull/35007

Mitch-At-Work avatar Aug 11 '25 16:08 Mitch-At-Work