SPOL : Access Denied when you upload a custom css on the Style Library
In the modern SPOL, when you try to upload a custom css file, you end up getting an error like this.
This is related to the No script setting in Modern Sites, you may need to use the below PS snippet to turnoff NoScript on the Modern Site.
Connect-SPOService -Url https://<tenantname>-admin.sharepoint.com Set-SPOSite -Identity https://<SiteUrl> -DenyAddAndCustomizePages 0
One other way of doing this is to inject using one of the SPFX PnP widget - https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-add-js-css-ref
Comments