Theme Colors
Theme colors are based on a subset of the Material Design color palette.
The above classes all set the background and a complimentary foreground color. However, you can use the background and foreground colors separately by simply prefixing the class name with background- or color- respectively. See the following example.
Example<div class="text-sm"> <div class="flex-row flex-padding-xs"> <div class="flex-col flex-fit background-accent-1-dark color-info-light">Lorem ipsum</div> <div class="flex-col flex-fit background-accent-4-dark color-success-light">Lorem ipsum</div> <div class="flex-col flex-fit background-accent-5-dark color-warning-light">Lorem ipsum</div> </div> </div>
If you are using the full WebUI CSS file, then you are also able to set border, boundary, and outline colors by prefixing with border-, boundary-, or outline-.
Naming conventionTo use the event color classes the following format should be followed. [element attribute]-[element event]-[theme color].
For example background-focus-info or border-hover-accent-1
Color CombinationsColor combinations should always be chosen carefully, taking into account people with partial sight and / or color blindness.
Translucency
The translucent-* classes range from a zero alpha transparency to a value of 0.9, and just like the theme colors, they can be used to set background, foreground, border, boundary, or outline. Here is a list of the translucency classes available:
Making use of translucency is one easy way to get more color shades.
Example<div class="container background-accent-1-dark color-light"> <div class="panel background-translucent"> Pellentesque habitant morbi tristique senectus </div> <div class="panel background-translucent-1"> Pellentesque habitant morbi tristique senectus </div> <div class="panel background-translucent-2"> Pellentesque habitant morbi tristique senectus </div> <div class="panel background-translucent-3"> Pellentesque habitant morbi tristique senectus </div> <div class="panel background-translucent-4"> Pellentesque habitant morbi tristique senectus </div> </div>
Focus and Hover Events
WebUI has a full range classes supporting focus and hover events for colors. These are used for various types of button by default, but are also there for you to use on other elements.
ExampleSupported ElementsNot all HTML elements accept focus events by default. If you need focus events for elements such as divs or spans, then you will need to to add a tabindex attribute to them and set the value to -1.
<div class="container gap-vertical-md"> <div class="container"> <button type="button" class="menu-button-sm menu-button-info rounded-md background-focus-accent-2">Background Focus</button> </div> <div class="container"> <input type="text" class="input-lg width-full rounded-md border-focus-accent-2" placeholder="Border Focus" /> </div> <div class="container"> <button type="button" class="menu-button-sm menu-button-info rounded-md background-hover-accent-2">Background Hover</button> </div> <div class="container"> <input type="text" class="input-lg width-full rounded-md border-hover-accent-2" placeholder="Border Hover" /> </div> </div>