-
Notifications
You must be signed in to change notification settings - Fork 381
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
Placeholder Control not working in Teams theme #1130
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Thank you for submitting your first issue to this project. |
Hi @DJoshi23, many thanks for reporting this issue. Would you be interested in submitting a PR? |
Hi @DJoshi23 and @joelfmrodrigues, I tried by using the latest public version of the library (3.7.2) and for me the result is this one (using a SPFx 1.14.0 solution with a standard Web Part deployed as a Teams Tab): So, my advice is to update both this library and the whole SPFx project to the latest version. However, the classic problem remains, namely the fact that a solution deployed in this way loses some styles such as the font and the real Teams theme applied (a problem that has been well known for a long time). @joelfmrodrigues what do you think? Is it time for a check to manage the Fluent theme if you are within Teams? Some kind of In this case I can work on a check like that 🙂 |
@fabiofranzini are you referring to a control/helper that would be responsible for the theme on it's own and could be used with any other control to address the issue? |
Exactly! The same problem exists for the isolated web parts, it could be solved in this way, by wrapping the controls to be used as children of this "new control". This solves the problem universally, even for all fluent controls. |
Yup, that would be amazing to have 🙂 it's definitely one of the pain points with SPFx in my opinion as it's always complex to handle and test across all scenarios. |
Ok, there are two things. The problem described by @DJoshi23 remains, even if I pass him a correct theme it seems that the I will work on it and update you. |
First implementation done: As you can see, the theme colors are applied based on the selected Teams theme, the same thing for fonts too. @joelfmrodrigues do you prefer that we leave this issue for the Placeholder control and create a new one for the new control I called "EnhancedThemeProvider"? |
Ok, I checked the code of the Placeholder control and I realized that sass was used for the style part.
@joelfmrodrigues If you tell me it's ok, I can start tweaking the control |
@fabiofranzini sorry for the late reply... |
Ok, I've finished updating the code to support the themes and theme variations of the sections in the Placeholder control and I'm ready to do the PR. Now, the problem raised by this issue remains, that is, if you set the Teams theme as High Contrast, the result remains the one shown by @DJoshi23. This is because using SPFx in Teams, Teams using a SharePoint page under the hood that has a theme applied that mimics that of Teams but isn't. The reason is simple, Teams uses a UI framework which is Fluent React NorthStar instead SPFx uses Fluent UI React. So how to solve the problem of this issue:
The first point is made while for the second I am working on it.
What do you thinks @joelfmrodrigues? |
@DJoshi23 this has now been fixed by @fabiofranzini and the PR was merged to the dev branch. You can get the updates if you install the beta version and if you do give it a try, please let us know if you find any issues. It looks great so far 👏 |
@joelfmrodrigues @DJoshi23 the problem is not completely resolved because the Hight Contrast theme in SPFx is not equal to the Hight Contrast theme in Teams... I'm working on another control (something like |
Ups, sorry for my confusion and thanks for clarifying @fabiofranzini |
Hi all, just an update: #1202 (comment) |
Hi @DJoshi23, Following amazing work done by @fabiofranzini, did you had the chance to retry with the EnhancedThemeProvider which is available since 3.9.0? |
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities. |
Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently. |
Hi,
I have created SPFx webpart with Placeholder Control and added webpart in Teams application as a Teams Tab.
Issue Description : If I change the Teams Theme to High contrast then Placeholder Control not looking properly. Please find the below image for your reference
and same type of theme issue i am facing in other control as well .
Version :
SPFX version : 1.12.1
"@pnp/spfx-controls-react": "3.2.1"
"@pnp/spfx-property-controls": "^3.2.0",
Thank you in advance
The text was updated successfully, but these errors were encountered: