docs(react-components): Add theming docs#23080
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 69f4a53:
|
📊 Bundle size report🤖 This report was generated against bad6ad63ff7e2287519e7117f8a1963b623ae18e |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: bad6ad63ff7e2287519e7117f8a1963b623ae18e (build) |
|
|
||
| Fluent UI Theme is represented by a set of tokens. Each token resolves to a single value which can be assigned to a CSS property. | ||
|
|
||
| You can browse all the available tokens in **Theme** section of the docs. |
There was a problem hiding this comment.
You can actually hyperlink to other pages or other parts of the same page. You can find some examples on the docs of build time optimization of Griffel
There was a problem hiding this comment.
Yeah, I know. the problem is Theme is a non-linkable section, not a page :-/
There was a problem hiding this comment.
maybe just link to the most 'natural' part of that section like the color tokens ?
Co-authored-by: ling1726 <lingfangao@hotmail.com>
|
|
||
| # Theming | ||
|
|
||
| The Fluent UI Theme is represented by a set of tokens. Each token resolves to a single value which can be assigned to a CSS property. |
There was a problem hiding this comment.
| The Fluent UI Theme is represented by a set of tokens. Each token resolves to a single value which can be assigned to a CSS property. | |
| The Fluent UI Theme is represented by a set of tokens. Each token resolves to a single value which can be assigned to a CSS property. | |
| ```tsx | |
| const theme = { | |
| tokenA: 'var(--tokenA)', | |
| // etc. | |
| } | |
| ``` |
Will it be helpful to show what it actually means?
There was a problem hiding this comment.
Sure, but the theme object is semantic name -> raw value, so I added an example of that. The later sections explain how that is added to DOM and consumed in styles.
Co-authored-by: Oleksandr Fediashov <alexander.mcgarret@gmail.com>
* docs(react-components): Add theming docs * Apply suggestions from code review Co-authored-by: ling1726 <lingfangao@hotmail.com> * Apply suggestions from code review Co-authored-by: Oleksandr Fediashov <alexander.mcgarret@gmail.com> * address PR comments * remove broken import Co-authored-by: ling1726 <lingfangao@hotmail.com> Co-authored-by: Oleksandr Fediashov <alexander.mcgarret@gmail.com>
Add theming docs for v9.
PREVIEW
Fixes #22358