Sometimes we need to programmatically determine whether SPWeb has its own alternate css or inherits alternate css from its parent site. In UI we can find this option “Inherit Alternate CSS URL from parent of this site” in Site Settings > Master page (it is available for publishing sites only):
If we will look at SPWeb class we will find that it has public property AlternateCssUrl of string type:
As “Master page” page is available only for publishing sites, my first idea was to check PublishingWeb class for boolean property like InheritAlternateCssUrl (similiar to InheritGlobalNavigation and InheritCurrentNavigation). But there is no such property in PublishingWeb. Instead, it also has AlternateCssUrl property as SPWeb. But instead of string type PublishingWeb . AlternateCssUrl property has InheritableStringProperty type:
In turn InheritableStringProperty class has boolean IsInheriting property. So in order to determine whether web site inherits alternate css URL from parent site or not we should obtain PublishingWeb object and check its AlternateCssUrl.IsInheriting property:
Using this technique you will be able to determine alternate css inheritance programmatically.