SharePoint Document Issues

SharePoint Online: Upload CSS Files to the Style Library When Approval Is Required

Kushani NimanthikaKushani Nimanthika Nov 13, 2026 868 views

Question details

Administrators need to upload CSS or XSL files to the SharePoint Online Style Library but SharePoint repeatedly requests approval or blocks the upload because custom script is disabled.

Upload CSS Files to the SharePoint Online Style Library
Product
SharePoint Online
Device & OS
not provided
Scenario
A SharePoint administrator is trying to add or update style sheet files in the Style Library.
Observed behavior
SharePoint Online repeatedly requests approval or prevents the upload of CSS and XSL files.
Before you start

Before changing SharePoint settings, confirm you have SharePoint administrator permissions for the site collection and review Microsoft's custom script guidance for your tenant.

Solution 1Recommended

Enable custom script in SharePoint Online to allow Style Library CSS uploads

Use this solution when SharePoint Online keeps asking for approval or blocks CSS and XSL file uploads to the Style Library.

SharePoint Online treats CSS and XSL files as files that may contain script. When custom script is blocked at the tenant or site collection level, the Style Library upload can fail or require repeated approval.

Enable custom script only for trusted site collections and follow Microsoft's guidance for allowing or preventing custom script.

1
Open the SharePoint admin center

Sign in to the Microsoft 365 admin center, open SharePoint admin center, and use an account with SharePoint administrator permissions.

2
Go to Classic settings

In the SharePoint admin center, select Settings, then More features, and open the Classic settings page.

3
Allow custom script

In the Custom Script section, select Allow users to run custom script on personal sites and Allow users to run custom script on self-service created sites, then select OK.

4
Update the specific site collection if needed

If the issue only affects a specific site collection, connect to SharePoint Online PowerShell and run: Set-SPOSite -Identity "https://contoso.sharepoint.com/sites/yoursite" -DenyAddAndCustomizePages $false.

Enable custom script in SharePoint Online to allow Style Library CSS uploads
Allow up to 24 hours: SharePoint Online changes can take up to 24 hours to apply. If the upload is still blocked after that, open a Microsoft Support request.
Free Microsoft Office alternative

Use WPS Office as a free Microsoft Office alternative for SharePoint document work

WPS Office cannot change SharePoint Online custom script settings, but it is a free, lightweight Office alternative that opens, edits, and saves DOCX, XLSX, and PPTX files with high compatibility and a familiar ribbon interface.

  1. 1. Download and install WPS Office: Click Download WPS Office Free and install it on your Windows, macOS, Android, or iOS device.
  2. 2. Open a SharePoint document in WPS Office: Download the file from SharePoint Online, right-click it, and choose Open with WPS Office.
  3. 3. Save in Microsoft Office format: Use File > Save As to keep the file as DOCX, XLSX, or PPTX for seamless sharing with Microsoft Office users.
Free to download and use for everyday Office tasksStrong Microsoft Office format compatibility for DOCX, XLSX, and PPTX filesFamiliar ribbon interface makes migration from Microsoft Office easyLightweight design for smooth document editing outside SharePoint Online
microsoft office alternative - wps office

Frequently Asked Questions

Why does SharePoint Online keep asking for approval when I upload a CSS file to the Style Library?

SharePoint may treat CSS and XSL files as script-capable. If custom script is blocked, uploads can be blocked or sent for approval. Enable custom script for the tenant or site collection.

Where do I find the SharePoint Online custom script setting?

In the SharePoint admin center, go to Settings > More features > Classic settings, and review the Custom Script section. For a specific site collection, use SharePoint Online PowerShell with Set-SPOSite -DenyAddAndCustomizePages $false.

How long does it take for custom script changes to affect Style Library uploads?

SharePoint Online changes can take up to 24 hours to propagate. If uploads are still blocked after 24 hours, open a Microsoft Support request.

Can WPS Office fix SharePoint Online Style Library upload approval issues?

No, WPS Office cannot change SharePoint Online admin settings. Use SharePoint admin center or Microsoft Support for custom script issues; WPS Office can help you edit Office files after downloading them.

Does enabling custom script affect security?

Yes, it can allow users to run custom script, which may increase risk. Enable it only for trusted site collections and follow Microsoft's guidance.