I am working on modifying modern site pages, more specific the top banner image in the title area. We want to set a max-width and center the background image. The CSS part I have figured out.
The issue I am facing is that the page loads/renders before my spfx extension loads the custom css.
export default class BannerImageStylingApplicationCustomizer
extends BaseApplicationCustomizer<IBannerImageStylingApplicationCustomizerProperties> {
@override
public onInit(): Promise<void> {
SPComponentLoader.loadCss("https://xxx.sharepoint.com/sites/News/SiteAssets/BannerImageStyling.css");
return Promise.resolve();
}
}
This means that the banner image is full-width for a second or two before my custom css is applied.
Is there any way I can modify the banner image before the page is rendered/loaded?
Any suggestions?