Wednesday, August 18, 2010

SharePoint 2010 Publishing Site Gotchas

Just been playing with SharePoint 2010 Publishing sites and have found a couple of "gotchas", or items of interest where Microsoft have made little mistakes:

The first one relates to the default Master page for a Publishing Site. It is called "nightandday", however inside the master page and the associated css file, there are two spellings:
nightandday - attached to the body tag
nightanday - attached to the left navigation menu
If you are creating a new custom master page based on the nightandday master, be sure to update both class names to your new name.

The second one relates to the new themeable styles feature. This is where you can add 'commands' to the css file to tell SharePoint what to do with the colours when a site administrator changes the theme of the site.

The basic command is:
/* [ReplaceColor(themeColor:"Dark1")] */ background-color: #000000;
Adding this line to a css definition tells SharePoint to set the background-color of the relevant tag to the Dark1 colour of the site's theme.

There are 12 definable colours with five generated variations each (Lightest, Lighter, Medium, Darker, Darkest), giving a total of 60 colours to choose from for styling your site (not including all the other variations that can be created using extended commands such as tinting).

In the nightandday.css file, there are instances of a non-existent variation being used, e.g. Accent6-Light. SharePoint ignores the variation and the resulting colour is the base colour, i.e.:
Accent6-Light === Accent6

The below image shows the full colour table when the site theme is set to "Classic":