30-second answer
$web = Get-PnPWeb -Includes AlternateCssUrl
if ([string]::IsNullOrWhiteSpace($web.AlternateCssUrl)) { "None" }
else { $web.AlternateCssUrl }What this proves
Whether the site is configured to inject a custom stylesheet into its classic pages, and which file it is.
What it does not prove
- What the stylesheet changes. The property stores a path, not the intent behind it; the file may recolour a banner or restructure the whole chrome. Reading the CSS itself is a separate step.
- That modern pages are affected. They are not: alternate CSS applies to the classic experience. Its presence tells you about the site's past, and about what classic pages still look like.
PowerShell
Get-PnPWeb -Includes AlternateCssUrl, MasterUrl |
Select-Object @{n='AlternateCss'; e={ $_.AlternateCssUrl }},
@{n='MasterFile'; e={ Split-Path -Leaf $_.MasterUrl }}Read it together with the master page: the two are the classic branding pair, and a site with either has been deliberately styled.
Example output
AlternateCss MasterFile
------------ ----------
/sites/intranet/Style Library/corp.css seattle.masterExplanation
An empty value is the answer on most sites, and empty means observed-empty: the property loaded and there is no stylesheet. A populated value means somebody invested in classic branding, and that investment is the part of a migration that does not carry over. Modern sites express branding through themes and site designs; a corp.css does not translate, it gets rebuilt or retired.
Production considerations
- Load with
-Includes; an unloaded property returns null and is indistinguishable from "no stylesheet" unless you asked for it. - The path may point at the Style Library of the site or of another site. A stylesheet hosted centrally means the branding, and the blast radius of changing it, is shared.
Related governance rules
SPO-MODERN-004: the site loads an alternate stylesheet into every page
References
- Branding in the modern experience (Microsoft Learn)
- Get-PnPWeb (PnP PowerShell)
Found something wrong? Suggest a correction. The article source is not public; the engine it cites is.
What this answer underwrites
The engine reads these Microsoft operations to collect evidence, so what is established here is what those collectors rest on.
activitywhen a person last changed something on one siteagentsthe Copilot agents in one site, and the sources each declaresclassificationwhat a site records about the kind of content it holdsmodernityhow one site is built: template, branding, publishingownerswho administers one sitesharingwhat one site permits, and its default link