I want to load the CSS file from Style Library of the site. I have created the SPFx extension of type Application Customizer.
The purpose of the CSS loading is to change the UI of the web parts.
I have used SPComponentLoader to load the CSS.
public onInit(): Promise<void> {
Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);
SPComponentLoader.loadCss('<<SiteColl>>/Style%20Library/css/HomePageDesign.css');
return Promise.resolve();
}
The issue is when I am running the extension, it is loading the CSS file which I have inspected using the Chrome browser debugger tool.
When I make any changes to the css file from the Chrome debugger, it applies the css successfully as expected.
I guess it should be the sequence change when SharePoint is rendering the web parts and executing the extension.
What should be the solution for this?