import * as React from 'react'; import { NavLink } from 'react-router-dom'; import { Button, Provider, Text, Animation, Header } from '@fluentui/react-northstar'; import DocPage from '../components/DocPage/DocPage'; import ExampleSnippet from '../components/ExampleSnippet/ExampleSnippet'; import GuidesNavigationFooter from '../components/GuidesNavigationFooter'; import { CalendarIcon, EmojiIcon } from '@fluentui/react-icons-northstar'; export default () => (

Fluent UI is a fully themable component library. Theming is opt-in, allowing you to theme as much or as little as needed. Themes can be applied to your entire app, to specific subtrees, or to individual components. You can also infinitely nest and override themes.

Let's look at how this is done.

The recommended API for customizing the look and feel of components is through theme variables. Variables are both easier to use and more robust than styles. Setting a theme variable will ensure your value is properly applied to every applicable style in every supported usage of the component.

Variables are defined at two levels, the site level and the component level.

Site variables define your site, app, or business. These are global values, like brand colors and typography, that are shared across many components.

You define site variables using the Provider.

( )} />

Component variables define theme values for a specific component. This includes information such as colors, borders, or box model values.

You can define component variables on a single instance of a component.

( <> )} />

You can also define component variables for all components in a part of your render tree using the{' '} Provider.

( <> )} />

You can customize component variables for your entire app by defining component variables on a{' '} Provider at the root of your app.

First, prefer variables - In order to override component styles you must understand and align your overrides to the current theme's style implementation. You also must ensure you properly override styles for every permutation of props for the component, which can be complex at times. Otherwise, you risk breaking styles in some usages of the component. This makes style overrides more brittle and less desirable than variable overrides.

Styles are available as an escape hatch for when there is no suitable theme variable available for your needs. Component styles are CSS-like style objects that are converted to real CSS and applied to your component as HTML class names.

You can define styles on a single component instance.

This is green text} />

Every slot (named part) of every component also accepts styles that are applied to the root element of the slot.

(