0

I apply themes from @uifabric/azure-themes or @uifabric/theme-samples via the Customization component.

However, once I change the theme, I noticed that the theme colors set by the Customization component do not match those retrieved from @uifabric/styling's getTheme().

Shouldn't they match once the Customization component (set at the top of my react tree) has been set with the new theme? All of the fabric react components seem to change color properly.

user1763729
  • 167
  • 1
  • 11
  • More research: It looks like after reading the github fabric bootcamp and docs more carefully, that only components with `styled` or a `customizable` decorator are eligible to receive the new theme/styles (based on "scope" or "fields"). There's no hook version with the same functionality though. Since a lot computations are involved the implementations appear to try and curry and be smart to avoid expensive processing per render. – user1763729 Apr 07 '20 at 11:33

1 Answers1

0

A bit more fiddling and I created a hook that does what the decorator/styled-hoc does and it seems to work. A bit of extra work, but I guess getTheme() grabs something but whatever it is, it is not the same as going through the customizer even though the customizer should customize the current theme, at least in my thinking.

user1763729
  • 167
  • 1
  • 11