Skip to content

docs: explain design tokens and styling #1733

Answered by vnbaaij
tbasallo asked this question in Q&A
Discussion options

You must be logged in to vote

The example is given in https://www.fluentui-blazor.net/DesignTokens in the Using design tokens from code section.

The page describes the most common used design tokens. In the library we have made all of the design tokens available. You can inject them into your component ant then target specifc elements in you component with them. As you can see in the example code, a FluentButton is given a different accent color:

await AccentBaseColor.SetValueFor(ref2!.Element, "#185ABD".ToSwatch());

The implementation requires to always use a .ToSwatch when a color is involved. An important thing to note here is that the current design token implementation fro the web components (which is what we ex…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vnbaaij
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
docs:example Tutorial and example work
2 participants
Converted from issue

This discussion was converted from issue #1731 on March 24, 2024 17:47.