.red
.yellow
.green
.blue
.red-light
.yellow-light
.green-light
.blue-light
.light
.lighter
.grey
.grey-light
.grey-dark
.label
.label-(color)
.box
.box-(color)
.box-white-normal
.box-white-dark
.boxed
.box-shadow-none
.box-shadow-shallow
.box-shadow-normal
.box-shadow-deep
.box-shadow-deeper
The color collection in LESS variables look like this
@colors: {
red: @red;
yellow: @yellow;
green: @green;
blue: @blue;
red-light: @red-light;
yellow-light: @yellow-light;
green-light: @green-light;
blue-light: @blue-light;
light: @text-light;
lighter: @text-lighter;
grey: @grey;
grey-light: @grey-light;
grey-dark: @grey-dark;
};
The following styles loop through the collection to define new rules. Adding more to the collection, creates new rules. (And removing any, also removes rules).
The foreground color of the label is decided between @white
, or @text-color
based on a contrast threshold of the color. The threshold by default is 43%. It can be modified through
@front-color-contrast
@label-padding
. Border radius is set by
@label-radius
, if @enable-rounded
is set to true.
For white
rules, border size is set by @box-border
.
The foreground color is decided the same way as with labels.
@box-padding
. Border radius is set by
@radius
, if @enable-rounded
is set to true.
For white
rules, border size is set by @box-border
.
The shadow collection in LESS variables look like this (you can add or remove from the list)
@shadows: {
none: none;
shallow: 0 0 5px 0 rgba(0,0,0,.1);
normal: 0 2px 2px 0 rgba(@black,0.14), 0 1px 5px 0 rgba(@black,0.12), 0 3px 1px -2px rgba(@black,0.2);
deep: 0 6px 10px 0 rgba(@black,0.14), 0 1px 18px 0 rgba(@black,0.12), 0 3px 5px -1px rgba(@black,0.3);
deeper: 0 16px 24px 2px rgba(@black,0.14), 0 6px 30px 5px rgba(@black,0.12), 0 8px 10px -5px rgba(@black,0.3);
};
The following is a loop of these values to broduce .box-shadow-value
.
Define a list with .boxed
, and the li elements will inherit
.box
. Here is an example combining
.row-spaced.uc-6
with .boxed
<ul class="boxed row-spaced uc-6">
<li>Box Element</li>
<li class="box-yellow">Element</li>
<li>Element</li>
<li>Element</li>
<li class="box-red">Element</li>
</ul>
Adding a new color to the color collection produces new color rules for text, labels and boxes
/* in sh._vars.less color collection */
@colors: {
...
pink: #e611a6;
};
<div class="spaced">
<span class="pink">Pink text</span> <span class="label label-pink">Pink label</span>
</div>
<div class="box box-pink">Pink box</div>
Adding a new shadow definiton to the shadows collection, produces a new rule for the shadow.
/* in sh._vars.less shadow collection */
@shadows: {
...
inner: inset 0 0 2px 2px rgba(@black, 0.5);
};
<div class="box box-shadow-inner">Inner shadow</div>
Using .colorbox(color)
uses contrast
LESS function to generate front color.
/* This produces
background-color: #883373;
color: contrast(#883373, @text-color, @white, @front-color-contrast) */
.myclass {
.colorbox(#883373);
}