Skip to content

Instantly share code, notes, and snippets.

@wictorwilen
Created January 21, 2015 12:21
Show Gist options
  • Save wictorwilen/d4e2435f336fcd5abff5 to your computer and use it in GitHub Desktop.
Save wictorwilen/d4e2435f336fcd5abff5 to your computer and use it in GitHub Desktop.
Quickly edit AlternateCSSUrl in SharePoint
// Copy and paste this into the Console window in any browser debugging tool to edit the Alternate CSS for a site
var context = SP.ClientContext.get_current()
var web = context.get_web()
web.set_alternateCssUrl('assets/test.css')
web.update()
context.executeQueryAsync(
function(){
alert('CSS Updated')
},
function() {
alert('Error updating CSS')
})
@larnera
Copy link

larnera commented Jan 30, 2015

Thanks for sharing.

@marqueone
Copy link

Is there a way to revert this to its original value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment