Closed akatrukhin closed 3 years ago
Styling things in Fluent UI can be pretty difficult since there are at least 3 ways of doing it: using
styles
props, usingvariables
props, and using global & local themes. My understanding of the best practices are these:
- Where all instances of a Fluent UI component should change in an HVC, we should use local themes, e.g. buttons in the Toolbar need a font-weight of 400.
- Where there are a few key components whose styles should change to different design system tokens,
variables
makes a lot of sense since Fluent UI provides access tositeVaribles
there.- Where there are a few key components whose styles should change to specific values (usually spacing, position, display, pointer-events, etc), the
styles
prop usually makes the most sense.It's probably worth double-checking at least the styles applied in the nested local theme here since that could accumulate technical debt.
I completely agree, I have the same point of view. Please correct me, if something I implemented not in an appropriate way.
Dashboard component:![image](https://user-images.githubusercontent.com/21069453/94854817-57796d80-03e2-11eb-9ac2-d7678031a34f.png)