Skip to content

add tokens switch to storybook addon #34940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 58 commits into
base: extended-tokens
Choose a base branch
from

Conversation

rachethecreator
Copy link

@rachethecreator rachethecreator commented Jul 29, 2025

The "Tokens: Semantic/Legacy" button in Storybook's toolbar enables switching between semantic/legacy tokens

Dev site:
image

image

Public site:
image

image

Mitch-At-Work and others added 30 commits April 28, 2025 09:17
…ERGE TO MASTER) (microsoft#34542)

REMOVE BEFORE MERGING TO MASTER
Force merging to extended-tokens as this is a temporary local update only needed for testing
@rachethecreator rachethecreator self-assigned this Jul 29, 2025
@rachethecreator rachethecreator requested a review from a team as a code owner July 29, 2025 20:03
Copy link

Pull request demo site: URL

@Mitch-At-Work
Copy link
Contributor

Let's build this out for the react-component pages also as that's our core non-dev storybook:
image

Can be found under FluentDocsPage.stories.tsx:
image

@Hotell Hotell self-requested a review July 30, 2025 12:03
@rachethecreator rachethecreator requested review from a team as code owners July 30, 2025 14:08
@rachethecreator
Copy link
Author

Let's build this out for the react-component pages also as that's our core non-dev storybook: image

Can be found under FluentDocsPage.stories.tsx: image

@Mitch-At-Work Done! Also renamed to TokenSwitch, not sure if it matters any, but thought it flowed better with TOKEN_ID

@Mitch-At-Work
Copy link
Contributor

Good work, one small tweak:

  • In the main public storybook, let's default to 'legacy' for now (if we can default to different values, lets default to legacy in public and semantic in dev, if we can't separate initial state, we can just default both to legacy for now)
  • Let's flip the toggle options, so that 'on' state relates to 'semantic tokens enabled'

Copy link
Contributor

@Hotell Hotell left a comment

Choose a reason for hiding this comment

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

FYI: all DocBlocks are now part of our storybook addon , fully configurable from user land, making it also generic.

with that said I'm not sure how semantic tokens will scale in terms of generic implementation as our addon would be used in various fluent extensions, where I assume making use of semantic token would provide invalid experiences.

probably the best approach here is to spin a new sb addon kept only internally for now and once semantic tokens are globally available we can streamline to official SB addon

See

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.

7 participants