Skinning SharePoint – using custom CSS to override core.css

By Future-MOSS-Rocker

http://geekswithblogs.net/RogueCoder/archive/2007/02/06/105588.aspx

Somewhere, Heather Solomon said the way to go was to create your own CSS file and override all the classes and stuff in core.css. That way your stuff doesn’t get written over or some such nonsense… You can even divide your overrides into different files, which is something I really should do now, because it’s getting too big.

I can’t find where I read that, but I should probably read this page:

http://www.heathersolomon.com/blog/articles/sp2007.aspx

Update 5-1-2008: Core.css isn’t used by all of the system pages in the _layouts folder, so for those you need to create a theme. Themes can only be deployed at the site level, there is no inheritence, so that’s why overriding core.css and specifing your custom css file as the alternate CSS on the top level of your site is good.

I like long sentences.

Today I also learned that there are 26 different css files used by SharePoint, but I will probably only have to mess with a handful.

Update 05-11-2008: Well a few days ago when I opened my eyeballs, I noticed that pages coming from the /_layouts/ folder actually were appearing with my custom branding. How is this possible? Well, I did something really smart without even knowing it. I specified an alternate CSS file through the SharePoint site interface, and apparently the application.master pages DO use that CSS file. They even take care to load it last to ensure your overrides don’t get overwritten.

So far, the only things I haven’t been able to fix with my one custom style sheet are:

  1. The “edit in datasheet” view of a list (well, sorta..)
  2. The “Access Denied” error page.

That’s not to say everything else is fixed, because I’m sure there are plenty of things I just haven’t noticed or thought about yet.

Tags: , , , , , , , , , , ,

Leave a Reply