docs: cleanup docs pages#23187
Conversation
| ## Server-Side Rendering | ||
|
|
||
| Fluent UI fully supports Server-Side Rendering. | ||
| Fluent UI React v9 fully supports Server-Side Rendering. |
There was a problem hiding this comment.
Mention this explicitly to avoid confusion.
| - primitive (`string`, `number`, `boolean`) | ||
| - HTML element (`div`, `span`, `img`) | ||
| - JSX component (`<MyCustomControl />`) | ||
| - render function (() => React.ReactNode) | ||
| - props object (InputProps, IconProps) | ||
| - render function (`() => React.ReactNode`) |
| - render function (() => React.ReactNode) | ||
| - props object (InputProps, IconProps) | ||
| - render function (`() => React.ReactNode`) | ||
| - props object (`InputProps`, `LabelProps`) |
There was a problem hiding this comment.
I replaced IconProps as we don't rely have them in react-components
|
|
||
| For example, the Avatar component has a badge slot. | ||
| Avatar limites this slot to components or render functions with PresenceBadgeProps props. | ||
| Avatar limits this slot to components or render functions with `PresenceBadgeProps` props. |
| ## Styling components | ||
|
|
||
| To style Fluent UI components `makeStyles` is used. | ||
| To style Fluent UI React v9 components `makeStyles` is used. `makeStyles` comes from [`Griffel`](https://griffel.js.org) a homegrown CSS-in-JS implementation which generates atomic CSS classes. |
There was a problem hiding this comment.
Updated to match latest changes
| When `mergeClasses()` is called, it merges all classes from first to last - the latter argument overwrites the previous ones (similar to `Object.assign()`). | ||
|
|
||
| ```jsx | ||
| import { makeStyles, mergeClasses } from '@fluentui/react-components'; |
There was a problem hiding this comment.
Added imports everywhere to make snippets copy-pastable
| No matter what theme is used, the component styles are always the same. The only way to change the component styling is through theme tokens which can be used in style values. | ||
|
|
||
| ```js | ||
| import { tokens } from '@fluentui/react-theme'; |
There was a problem hiding this comment.
We recommend to use @fluentui/react-components, let's be consistent
|
|
||
| const useOverrides = makeStyles({ | ||
| button: { color: tokens.colorNeutralForeground3 }, | ||
| buttonIcon: { border: '1px solid red'}, |
There was a problem hiding this comment.
Oops, shorthands are not supported, updated it
| return ( | ||
| <> | ||
| <Button className={overrides.button} icon={{className: overrides.buttonIcon, children: <CallIcon />}} /> | ||
| <Button className={overrides.button} icon={{ className: overrides.buttonIcon, children: <CallEndRegular /> }} /> |
There was a problem hiding this comment.
Added real icon to be used
| import { Meta } from '@storybook/addon-docs'; | ||
|
|
||
| <Meta title="Concepts/Upgrading/from v0/Components/Textarea Upgrade" /> | ||
| <Meta title="Concepts/Upgrading/from v8/Components/Textarea Upgrade" /> |
There was a problem hiding this comment.
This causes funny collision as this page gets displayed for v0
| 'The `positioningRef` positioning prop provides an [imperative handle](https://reactjs.org/docs/hooks-reference.html#useimperativehandle)', | ||
| 'to manually position an element. The target can be a normal HTML element or a virtual element such as a', | ||
| 'coordinate on the viewport', | ||
| 'coordinate on the viewport.', |
| story: [ | ||
| 'The positioned element can be offset from the target element by using a callback function.', | ||
| 'The callback function provides the arguments and are a values used directly by Popper.', | ||
| 'The callback function provides the following arguments:', |
| '', | ||
| '- Simple array with X and Y axis values', | ||
| '- A function that returns the array offset value', | ||
| '- An object with `mainAxis` and `crossAxis` values', |
| const [crossAxis, setCrossAxis] = React.useState(10); | ||
| const [mainAxis, setMainAxis] = React.useState(10); |
There was a problem hiding this comment.
Changes names in snippet to match actual code
|
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 3de9808:
|
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: dd94d998cb154a07cfc70ac760707231c18e41e8 (build) |
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 1284 | 1212 | 5000 | |
| Button | mount | 772 | 810 | 5000 | |
| FluentProvider | mount | 2288 | 2243 | 5000 | |
| FluentProviderWithTheme | mount | 392 | 428 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 370 | 380 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 455 | 452 | 10 | |
| MakeStyles | mount | 1968 | 1983 | 50000 |
See comments on files directly 👇