Tuesday, 11 November 2008

Creating a Global Theme using a single CSS stylesheet

Lately I've been working on a lot of SharePoint branding – for MOSS and WSS. For a consistent user experience, we need to brand the application pages too (/_layouts/…), so we create a custom theme.

There are many other articles about creating custom themes:

One of the pain points with developing your own theme comes when it has been rolled out across many sites, and then a snag is spotted, or something needs to be changed. The theme has to be updated, and re-applied everywhere it was used (since applying a theme in a site takes a copy of the CSS and supporting files and stores it in each site). Imagine having to do that across 50+ sites – it is certainly something that can make you cry.


To get around this, and allow us to make global changes post-deployment, I use the following method.

  1. Copy an existing theme, and make the necessary changes to the files to make it your own and customise the CSS (the above articles cover this) – and there is a theme generator out on the web: (http://hermansberghem.googlepages.com/themegenerator.htm)

  2. Somewhere in the root of your SharePoint system, create a blank CSS page – "MyTheme.css".

  3. Cut the CSS from your new theme on the server, and paste it into MyTheme.css.

  4. Go back to your CSS sheet on the server, remove all the text from it, and enter only the following line:
    @import:url('/MyTheme.css');

  5. Save + Reset IIS

Presto – now, all your custom theme does is look at a single parent style sheet in the root of your SharePoint system. This means that even after it's been deployed across many sites, we can make a change to the parent style sheet and see it reflected everywhere.


Hope this helps…davros.



SharePoint makes me cry...

Hello all -

I'm David (davros), and I work as a SharePoint + InfoPath consultant @ ISC Software Solutions (MS Gold Partner - http://www.isc-software.com/).


Recently I have come across a few things in SharePoint that have damn well near reduced me to tears. So, after finding work arounds and drying my eyes - I thought I would try and share them here, perhaps to help others avoid some of the pain.


I have been mainly working in the following areas of late:

  • SharePoint branding + customisation

  • InfoPath - custom task pane / dynamic form creation / etc

  • InfoPath Forms Services

I have recently completed the two MCTS exams for configuring SharePoint.

Anyway - hopefully some of my thoughts will be of use to someone....

.davros.