Wednesday, 14 August 2013

SharePoint 2013 - Themes and Creating custom theme

SharePoint 2013 - Themes and Creating custom theme

SharePoint 2013 is not supporting ".THMX" files in SharePoint 2010. If we migrate site in SharePoint 2010 to SharePoint 2013, try to apply for custom themes it will not support us. So we have to re-create the theme in SharePoint 2013. Custom theme for SharePoint 2010 will be there after migrating the site, but site theme will set to default theme.
In SharePoint 2013 there is lot of Changes in Theming. We have two xml files to define the themes.
  • SPColor.xml, SPColor.xml contains the color schema with the names of UI elements. By changing the color value in xml file color will be changed on the theme.
  • SPFont.xml, SPFont.xml defines the font schema of the theme. It will support multiple languages, web fonts.
We can see SPFont.xml, SPColor.xml files in 15 folder theme gallery (_Layouts/themes/15). We can access theme gallery through UI by navigating to Site settings -> Themes (In web designer gallery)
We can see all the themes that are available in SharePoint site in Composed looks list. Following are the four columns we can see in the composed look list.
  • Color palette
  • Font scheme
  • Background Image
  • Master Page
Create new Theme:
To create new theme, Create new Composed look item and specify the Master Page URL- that to associate with the theme, Theme URL- SPColor xml file to apply the colors, Image URL- Theme Image URL to show in the theme gallery, Font Schema URL- SPFont xml file that to associate font file with the theme and Display Order value as shown in the image below.
I have selected the default master page (Seattle) and default SPFont file. To change the colors of the theme I have created new SPColor.xml file by using existing file as pallette040.spcolor and save it as Custom Theme.
To create new SPColor xml file Go to Themes gallery and download any .SPColor file. Here I have downloaded palette032.spcolor file as shown the image below.
Change few UI Elements like WebPartHeadingPageBackground in the XMl and save it as Palettle040.
Upload the file into theme gallery.
To apply the theme, Navigate to "Change Look" in Site settings - Look and feel section. 
Select Custom theme in the list. Here we are not created new image reference for the theme, only using existing image as reference. So that we can the same image for the theme that already existed. In the next step to apply the theme select "Try it Out" link
We can see the resulting page as shown below.
 

No comments:

Post a Comment