Including Cascading Stylesheets in Themes for Confluence 2.6
Firstly, you will need to disable the inclusion of Confluence 2.5.x styles. These were included by default to allow 2.5.x themes to remain compatible in Confluence version 2.6 and after.
To disable 2.5.x styles, add the following to your theme's
Note the flag
includeClassicStyles is set to
false. You will have to set this explicitly as the default is
Secondly, you will need to declare your custom theme style sheet in
atlassian-plugin.xml like this:
Differences from Confluence 2.5.x
- You no longer have to include your theme stylesheet in the main decorator using
#pluginStylesheetanymore. Confluence will load your theme's stylesheet automatically provided that its the active theme
- The resource is declared in the
thememodule instead of the
- You need to start your custom style sheet (say
my-css.vm), by copying over the latest styles from
. This step is necessary as Confluence now includes either your theme stylesheet or the default stylesheet, not both. This implies:
- you can no longer rely on the default styles being there to style parts of the Confluence you are not directly theming
- you are no longer overridding styles with your plugin style sheet. It is now the primary stylesheet
- you will need to merge any new styles in later versions of Confluence into your theme's style sheet
Multiple style sheets
It is possible to configure your theme to use multiple style sheets. This feature may useful if you want to break up your main style sheet into a few smaller style sheets with more defined purposes. You can declare these like so:
These style sheets will be included in the order in which they are declared.
Was this helpful?
Thanks for your feedback!