Skip to content

Field: Update to use Semantic Tokens - #34804

Merged
Mitch-At-Work merged 6 commits into
microsoft:extended-tokensfrom
terynk:user/terynkum/field-semantic-tokens
Jul 16, 2025
Merged

Field: Update to use Semantic Tokens#34804
Mitch-At-Work merged 6 commits into
microsoft:extended-tokensfrom
terynk:user/terynkum/field-semantic-tokens

Conversation

@terynk

@terynk terynk commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces a new useSemanticFieldStyles hook and integrates it into the Fluent UI library. The changes include defining and exporting the new hook, updating relevant style tokens, and adding the hook to the semantic style hooks configuration. Below is a summary of the most significant changes:

New Hook Implementation and Integration

  • Created the useSemanticFieldStyles hook in Field/useSemanticFieldStyles.styles.ts to provide styling for Field components, including handling various states, orientations, and validation messages.
  • Exported the useSemanticFieldStyles hook in Field/index.ts and added it to the SEMANTIC_STYLE_HOOKS configuration in semanticStyleHooks.ts. [1] [2] [3]
  • Updated the main library export file to include useSemanticFieldStyles.

Semantic Tokens Updates

  • Added new semantic tokens for Field styling, such as padding, spacing, and color tokens, to support the new hook. [1] [2] [3] [4] [5]
  • Updated existing tokens to include fallback values for better compatibility. [1] [2]

Token Mapping and Overrides

  • Added mappings for the new Field tokens in fluentLegacyVariants.ts and fluentOverrides.ts to ensure compatibility with both legacy and Fluent 2 design systems. [1] [2] [3] [4]

These changes collectively enhance the Fluent UI library by introducing a standardized way to style Field components, improving maintainability and consistency across the framework.

@terynk
terynk requested a review from a team as a code owner July 8, 2025 21:43

@Mitch-At-Work Mitch-At-Work left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantic token usage looks good!

Just a few small minor comments before landing

@Mitch-At-Work
Mitch-At-Work force-pushed the user/terynkum/field-semantic-tokens branch from d536cfb to d00896a Compare July 15, 2025 23:57
@Mitch-At-Work
Mitch-At-Work enabled auto-merge (squash) July 16, 2025 00:55
@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@Mitch-At-Work
Mitch-At-Work merged commit 9ca9756 into microsoft:extended-tokens Jul 16, 2025
10 of 14 checks passed
Mitch-At-Work added a commit that referenced this pull request Aug 6, 2025
Co-authored-by: terynkum <terynkum@microsoft.com>
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: terynkum <terynkum@microsoft.com>
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