-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Category
- Question
- Typo
- Bug
- Additional article idea
Expected or Desired Behavior
Web part should inherit at least background and font colour at least from the '.CanvasZoneContainer' instead of faulty overspecify styles.
Observed Behavior
Placing a web part with no styling at all lead to the following experience:
The issue is caused because .CanvasZone, .CanvasSection, .Controlzone, .ControlZoneEmphasisBackground overspecify a background color of white on each of the containers. In the end, a third party web part end up with white text on white background. The colour on the hand is not "overspecificed".
The web part, in this case, doesn't use any styling at all and just render 'Hello World'.
An intermediate fix to this issue can be accomplished with the following CSS that forces to the inheritance of 'background-color' and color properties from the '.CanvasZoneContainer' element where the "Colored Section" base properties are defined.
:global {
.CanvasZone,
.CanvasSection,
.Controlzone,
.ControlZoneEmphasisBackground {
background-color: inherit;
color: inherit;
}
}
The result of this fix is a correct displayed web part.
This fix works for the 'Neural':
Steps to Reproduce
- Create an empty web part that does not have any style included at all.
- Place the web part on a colored section on a SharePoint Page.