Skip to content

Latest commit

 

History

History
41 lines (23 loc) · 2 KB

creating-a-theme.md

File metadata and controls

41 lines (23 loc) · 2 KB

Creating a theme

A theme is a Jenkins plugin that includes:

  • 0 or more CSS files
  • 0 or more JavaScript files

Theme discovery in Jenkins uses the ThemeManagerFactory extension point.

Getting started

Create a plugin from the empty plugin Jenkins archetype.

You will need to extend/implement:

Take a look at the dark-theme-plugin for a sample implementation.

You can find all the available variables provided by Jenkins core in theme.less. Plugins may also define their own variables so this list may not be complete, but it should cover most of them.

Don't forget to add @Extension to your descriptor and UnprotectedRootAction.

Add a symbol to your descriptor for a nice short name when using configuration-as-code, e.g. @Symbol("neo2").

Testing your theme

Run mvn hpi:run from your plugin directory, that will startup a test instance of Jenkins.

Visit http://localhost:8080/jenkins in your browser and configure your theme from there.

Host your plugin

Follow the hosting guide.

Let others know about it

Send a pull request to this plugin's README to add it to the known plugins list (once the plugin is in the Jenkins update center).