How to customise own theme in Sharepoint 2010

I had been customising Sharepoing theme lately in 2010 version, and i have to say it’s not very fun, mainly due to lack of documentation online and a big change in UI elements comparing to version 2007.

Sharepoint 2010 allows you to optionally upgrade your UI to version 4, which is the new 2010 version or stays as version 3, which uses the 2007 style packages. What was good with 2007’s was that the style packages actually exist in the 12 hives folder, meaning you could actually go and open up the stylesheets and work from there. However with version 4, things turn ugly. Microsoft used the Office theme package (.thmx) to do its styling in Sharepoint.

All the styles are stored in this theme file, and there’s not much flexibility you could have in using this stupid file to style Sharepoint. If you just want to change some color for some elements in your Sharepoint, perhaps this might be good enough for you. Follow:

Advanced theming by overiding stock css

For more advanced theming, I figure the only way is to create your own CSS stylesheet, and attach to your master page, then make all sub-sites inheriting its parents theme (if you have better ideas, feel free to let me know).

Adding an overiding stylesheet to master page is straightforward. What you do is add a stylesheet tag within head tag in master file:

<SharePoint:CssRegistration ID=”myCustomStyle” Name=”http://localhost/_layouts/custom-v4.css” runat=”server” After=”corev4.css”></SharePoint:CssRegistration>

What this will do is, Sharepoint will render your custom stylesheet after it runs the default corev4.css.

Inheriting master page theme from parent

After that, this is where i hate Sharepoint… Most of the online sources say to make sub-sites inheriting parent’s theme, you’d have to go to Look and feel -> Master page and apply the Alternate CSS Url settings. But for mine, I just can’t see that. My Master Pages list just shows all master files I have .

Later I figured out that I have to visit http://<siteurl>/_layouts/changesitemasterpage.aspx. This will bring me to the right page where I can apply the theme inheritance.

You need to make sure you have Server Publishing Infrastructure Feature activated (bad luck to those using Sharepoint Server Foundation, you’d have to apply the theming manually in Sharepoint Designer).


Categories: Sharepoint 2010