-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added 'EnhancedThemeProvider' control #1206
Added 'EnhancedThemeProvider' control #1206
Conversation
Hi @AJIXuMuK and @joelfmrodrigues with the last commit I finalized the default, dark and high contrast theme for Teams. As mentioned in the Twitter thread with @AJIXuMuK, I created a repo to individually test the various Fluent controls (not all but most) with the default themes and the ones I created instead. Specifically, you can see the themes applied using this branch: https://github.com/fabiofranzini/spfx-test-fluent-ui-theme/tree/custom-teams-themes For this component, as you can see, I have placed the themes in the "common" folder, to share these themes with other components as well (for example the Thanks in advance 🙂 |
d8fad5f
to
4306d9a
Compare
@fabiofranzini Many thanks for another great contribution! |
Hi @joelfmrodrigues I just fixed the package.json! Thanks 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabiofranzini Great stuff! I just added 2 minor comments as I think you are using the same function in different locations
@fabiofranzini sorry just another note. As you are adding a new control, can you also update the documentation links so it get's displayed on the site? |
Great, sorry for that but I've completely missed this step! Thanks again |
@fabiofranzini Merged! 👏👏👏 |
Great, thanks for your feedback! |
What's in this Pull Request?
I added the new 'EnhancedThemeProvider' Control used to improve support for themes and fonts when creating Tab or Personal App in SPFx for Teams or creating Isolated Web Parts.
The reasons behind this control are many and concern the use of Fluent UI controls currently officially supported by SPFx, that is:
Problems with Teams theme support
, when hosting a Web Part like Tab or Personal App and specifically the lack of support by this version of Fluent UI React of the high contrast theme.Lack of basic style
, such as fonts, for basic HTML elements when creatingWeb Parts hosted in Teams as Tabs or personal App
.Web Parts in "isDomainIsolated" mode
, aka the Isolated Web Parts.Therefore, the control is to be considered as a sort of
wrapper for all react and non-react controls
that you want to add to the WebPart.The control
extends the functionality of the Fluent UI ThemeProvider control
(currently in version 7) by adding some logic thanks to the information contained in the 'context' property, that is:As for Teams, given the inconsistency of the theme system of Fluent UI NorthStar (used in Teams) and Fluent UI React (used by SPFx), the themes are "emulated".
The control contains the refining of Teams'
Default
,Dark
andHight Contrast
themes.This is just an example on Teams with
Hight Contrast
theme applied: