Theme API

DRAFT
OpenROV Themes live in subdirectories residing in src/static/themes/. The Theme's subdirectory holds all of the Theme's stylesheet files, template files, and optional functions file (functions.js), JavaScript files, and images. For example, a Theme named "test" would reside in the directory src/static/themes/test/. Avoid using numbers for the theme name, as this prevents it from being displayed in the available themes list.

OpenROV includes a default theme in each new installation. Examine the files in the default theme carefully to get a better idea of how to build your own Theme files.

OpenROV Themes typically consist of three main types of files, in addition to images and JavaScript files. One is the stylesheet called style.css, which controls the presentation (visual design and layout) of the website pages. The second is the optional functions file (functions.js). The other files are the template files which control the way the site pages generate the information from your OpenROV to be displayed on the server.

Using a Theme

To include a given theme, first include the themeName.css file:

Then, add a theme class name to the parent element, like:

It is recommended you include the theme CSS file before calling any other JS files to avoid any potential race conditions where widgets start rendering before the theme has finished loading. Thus, putting it all together: