This repository has been archived by the owner on Oct 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
sp component base.themeprovider
John Nguyen edited this page Apr 22, 2021
·
2 revisions
Home > @microsoft/sp-component-base > ThemeProvider
The ThemeProvider class provides the capability to get different themes from the Framework. Themes can be provided in different contexts, e.g. Canvas sections may provide a variant of the global theme in some contexts.
Signature:
export declare class ThemeProvider
Property | Modifiers | Type | Description |
---|---|---|---|
themeChangedEvent | SPEvent<ThemeChangedEventArgs> | Raised when the theme changes with the new theme as an argument. |
Constructor | Modifiers | Description |
---|---|---|
(constructor)(serviceScope, theme) | Construct a new instance of the ThemeProvider class. |
Property | Modifiers | Type | Description |
---|---|---|---|
serviceKey | static |
ServiceKey<ThemeProvider> | The service key for ThemeProvider. |
Method | Modifiers | Description |
---|---|---|
tryGetTheme() | If set, get the current scoped theme. |