Class: RenderTheme

RenderTheme

The RenderTheme class provides a mechanism to style separate components generated from a Renderer object. The theme's CSS is injected into the DOM under the supplied selectors. This allows switching between themes on client rendered tiles by simply appending the respective selector to a parent DOM element. It is the Renderer implementations responsibility to ensure that the RenderTheme object is utilized correctly, as different implementations may require unique styling. An alternative to using RenderThemes would be either bypassing Renderers all together and using the lower level html provider function accepted by client rendered layers, or using the hook function to insert application or theme specific classes into the generated html entries.

new RenderTheme(theme, spec)

Instantiate a RenderTheme object.
Name Type Description
theme String The theme identification string. Currently restricted to "dark" and "light".
spec Object The specification object.
{
    color                  {String} - The css color attribute for the component.
    color:hover            {String} - The css color attribute for the component, under hover.
    background-color       {String} - The css background-color attribute for the component.
    background-color:hover {String} - The css background-color attribute for the component, under hover.
    text-shadow            {String} - The css text-shadow attribute for the component.
    border                 {String} - The css border attribute for the component.
}