Skip to content

Update Badge to use semantic tokens - #34765

Merged
Mitch-At-Work merged 8 commits into
microsoft:extended-tokensfrom
terynk:user/terynkum/react-badge-semantic-tokens
Jul 15, 2025
Merged

Update Badge to use semantic tokens#34765
Mitch-At-Work merged 8 commits into
microsoft:extended-tokensfrom
terynk:user/terynkum/react-badge-semantic-tokens

Conversation

@terynk

@terynk terynk commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces semantic tokens to the @fluentui/react-badge package, replacing hardcoded design tokens with semantic token references for improved flexibility and maintainability. It also updates dependencies and adds new semantic token definitions to support these changes.

Note: Severe and Subtle colors DO NOT have semantic tokens. Code for those color variations was left alone.

Integration of Semantic Tokens

  • Added semantic tokens to the Badge component, replacing existing design tokens for properties such as font family, font weight, font size, padding, border radius, and colors across various badge styles (e.g., filled, ghost, outline, tint) in useBadgeStyles.styles.ts. This ensures consistency and easier customization. [1] [2] [3] [4] [5] [6] [7]

Dependency Updates

  • Added @fluentui/semantic-tokens as a dependency in the package.json file for the @fluentui/react-badge package to utilize semantic tokens.

Semantic Token Definitions

  • Introduced new semantic token definitions in semantic-tokens.api.md, including tokens for padding, font weight, and color fallbacks. These tokens provide default values and fallback mechanisms for better design token management. [1] [2] [3] [4] [5] [6] [7]

Documentation Updates

  • Updated the change log to reflect the addition of semantic tokens to the Badge component as a minor feature.

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

Comment thread packages/semantic-tokens/src/fluentOverrides.ts
Comment thread packages/semantic-tokens/src/control/tokens.ts Outdated
@Mitch-At-Work
Mitch-At-Work force-pushed the user/terynkum/react-badge-semantic-tokens branch from 40734f9 to d692745 Compare July 15, 2025 01:21
@Mitch-At-Work
Mitch-At-Work self-requested a review July 15, 2025 01:25
@Mitch-At-Work
Mitch-At-Work merged commit 7e2289e into microsoft:extended-tokens Jul 15, 2025
10 of 14 checks passed
Mitch-At-Work added a commit that referenced this pull request Aug 6, 2025
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
Mitch-At-Work added a commit that referenced this pull request Aug 20, 2025
Co-authored-by: Mitch-At-Work <mifraser@microsoft.com>
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.

3 participants