Windstorm comes with 3 pre-built themes: Light, Dark, and Tron.
The light and dark themes are tuned for normal people, while the tron theme is a high contrast theme that only a handful of people will like (me).
To create a custom theme, a single css rule needs to be defined with a number of variables that windstorm uses in the components and functions.
The selector should be: [ws-x~="@@theme:<theme name>"]
Windstorm uses css custom properties (css variables) to control a number of aspects of the styles without the need for js.
The text proprties control the size, color, and font of the text on the page.
--font
--text-light
--text-dark
--text-color-normal
--text-color-secondary
--text-color-invert
--text-color-fill
--text-size-normal
--text-size-title
--text-size-header
--text-size-info
--text-size-subtitle
These variables control the overall look and feel of the components in multiple states, as well as the page itself.
--background
--background-layer
--background-element
--layer-border-width
--layer-border-color
--ripple-normal
--shadow-color
--disabled-background
color-scheme
Optional dark
as a reliable, cross-browser solution
to the coloration of things like scrollbarsThe theme colors are used with the $color[<name>]
function. The colors are
applied to various parts of a component (border, text, background, etc.). The
ripple colors are used for things that have a ripple effect on them, usually
only button
or a
's with $button
on them.
--default
--default-ripple
--primary
--primary-ripple
--secondary
--secondary-ripple
--danger
--danger-ripple
--warning
--warning-ripple
--accent
--accent-ripple
/* Replace custom with your theme name */
[ws-x~="@@theme:custom"] {
/* Font Display */
--font: ;
--text-light: ;
--text-dark: ;
--text-color-normal: ;
--text-color-secondary: ;
--text-color-invert: ;
--text-color-fill: ;
--text-size-normal: ;
--text-size-title: ;
--text-size-header: ;
--text-size-info: ;
--text-size-subtitle: ;
/* Page/Component Styles */
--background: ;
--background-layer: ;
--background-element: ;
--layer-border-width: ;
--layer-border-color: ;
--ripple-normal: ;
--shadow-color: ;
--disabled-background: ;
color-scheme: ;
/* Theme Colors */
--default: ;
--default-ripple: ;
--primary: ;
--primary-ripple: ;
--secondary: ;
--secondary-ripple: ;
--danger: ;
--danger-ripple: ;
--warning: ;
--warning-ripple: ;
--accent: ;
--accent-ripple: ;
}