This documentation relates to an earlier version of Confluence.
View this page in the current documentation or visit the current documentation home.
Skip to end of metadata
Go to start of metadata

Confluence allows you to integrate your own stylesheets within the theme plugin so you can have greater control over the appearance of your site. Confluence's main stylesheet is a useful reference when overriding styles and can be found in the Confluence install directory under ...confluence/WEB-INF/classes/styles/site-css.vm.

Step One: Defining the stylesheet in the atlassian-plugin.xml

To make a stylesheet available to a decorator, you will need to reference it as a resource from within the central configuration file - atlassian-plugin.xml.

Here is an example where a stylesheet is being used to define the 'leftnavigation' theme:


The resource parameter takes three arguments:

  • Type: The type of resource-in this instance, 'stylesheet'.
  • Name: The name of the stylesheet.
  • Location: The location of the file represented in the jar archive you will use to bundle your theme.

Step Two: Using the stylesheet in the decorator

To reference the stylesheet in the decorator, you will need to use the #pluginStylesheet velocity macro.

For example, here's how you reference the leftnav.css file defined in the layout entry above:

The macro takes two arguments:

  • completePluginKey: The complete plugin key which is constructed from the pluginkey and the layout key like this: {pluginKey}:{layoutKey}
    In the above example, com.atlassian.confluence.themes.leftnavigation is the key of the plugin, and main is the key of the layout.
  • stylesheetName: the name of the stylesheet

If you place your stylesheet after the #standardHeader macro in the decorator, the contents of your custom stylesheet will override those in Confluence's default stylesheet.

If your stylesheet needs to reference the colour scheme, you need to use the space stylesheet macro instead:

You can then use colour scheme references in your stylesheet, similar to Confluence's stylesheets, and they will be replaced with the appropriate global or space-specific colour scheme:

RELATED TOPICS
Page: Creating a Theme (Confluence 3.4)
Page: Applying a Theme to a Space (Confluence 3.5)
Page: Configuring the Documentation Theme (Confluence 3.5)
Page: Configuring the Easy Reader Theme (Confluence 3.5)
Page: Including Cascading Stylesheets in Themes (Confluence 3.4)
Page: Configuring the Documentation Theme (Confluence 3.3)
Page: Configuring the Easy Reader Theme (Confluence 3.2)
Page: Applying a Theme to a Space (Confluence 3.2)
Page: Configuring the Documentation Theme (Confluence 3.2)
Page: Including Cascading Stylesheets in Themes (Confluence 3.1)
Page: Including Cascading Stylesheets in Themes (Confluence 2.10)
Page: Themes Overview (Confluence 2.10)
Page: Themes Overview (Confluence 2.7)
Page: Including Cascading Stylesheets in Themes (Confluence 2.7)
Page: Applying A Theme To A Space (Confluence 2.6)
Showing first 15 of 95 results