fluentui
fluentui copied to clipboard
Feat: Semantic Tokens
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
📊 Bundle size report
✅ No changes found
Pull request demo site: URL
Moved core changes (nessecary exports) to https://github.com/microsoft/fluentui/pull/35007