Color
Variables
$palette
The color palette map, can be extended or modified with set() and accessed with get()
- Note do not use names that start with "var(" which are reserved for custom properties. Also do not use "inherit" or "transparent" as those are reserved.
- The default palette color names are used throughout the system
$palette: (
"black": black,
"white": white,
"type": black,
"type-secondary": rgb(82, 82, 82),
"type-tertiary": rgb(125, 125, 125),
"type-disabled": rgb(160, 160, 160),
"headline": inherit,
"background": white,
"focus": blue,
"accent": orange,
"info": #00bde3,
"success": #00a91c,
"warning": #ffbe2e,
"danger": #d54309,
"info-background": #e7f6f8,
"success-background": #ecf3ec,
"warning-background": #faf3d1,
"danger-background": #f4e3db,
// Used for background of elements that are placeholder or that have no value (think charts)
"placeholder-background": #e2e2e2,
"placeholder-background-alt": #bababa,
"selected": green,
"box-shadow": rgba(0, 0, 0, 0.349),
"box-shadow-hover": rgba(0, 0, 0, 0.5),
"rule": gray,
"rule-light": lightgray,
"link": blue,
"link-hover": darkblue,
"link-active": darkblue,
"link-visited": purple,
"bullet": inherit,
"control": white,
"control-hover": white,
"control-active": white,
"control-border": purple,
"control-border-hover": blue,
"control-border-active": orange,
"control-background": purple,
"control-background-hover": blue,
"control-background-active": orange,
// Like accent indicator like things in ui (progress, etc)
"indicator" : #5050ab,
);
File Information
- File: _color.scss
- Group: color
- Type: variable
- Lines (comments): 13-16
- Lines (code): 18-61
$contexts
Pairs of background-color and color definitions
$contexts: (
"dark" : (
"background-color" : "black",
"color" : "white",
"base-class" : true
),
"light" : (
"background-color" : "white",
"color" : "black",
"base-class" : true
),
);
File Information
- File: _color.scss
- Group: color
- Type: variable
- Lines (comments): 63-67
- Lines (code): 69-80
Map Properties
| Name | Type | Description |
|---|---|---|
| $contexts.name.background-color | Number | String |
| $contexts.name.color | Number | String |
| $contexts.name.base-class | Boolean | Print this value in the base module as a class (if base prints) |
$color-classes
Palette entries that are output as classes when using all-color-class-styles
- Use set-color-classes mixin to alter this map
$color-classes: (
"black" : true,
"white" : true,
"type": true
);
File Information
- File: _color.scss
- Group: color
- Type: variable
- Lines (comments): 82-83
- Lines (code): 84-88
Mixins
set()
Used to override or extend the color palette
File Information
- File: _color.scss
- Group: color
- Type: mixin
- Lines (comments): 90-96
- Lines (code): 98-100
Examples
Setting the error and type color
@include ulu.color-set((
"type" : #444,
"error" : orange,
));
Parameters
| Name | Type | Description |
|---|---|---|
| $changes | Map |
A map to merge into the color palette |
Require
set-color-classes()
Set output classes for all-color-class-styles
File Information
- File: _color.scss
- Group: color
- Type: mixin
- Lines (comments): 125-126
- Lines (code): 128-130
Parameters
| Name | Type | Description |
|---|---|---|
| $changes | Map |
Map of changes (you can disable defaults this way) |
Require
set-contexts()
Set color contexts
File Information
- File: _color.scss
- Group: color
- Type: mixin
- Lines (comments): 139-149
- Lines (code): 151-153
Examples
Overwriting contexts
@include ulu.color-set-contexts((
"dark" : (
"background-color" : red,
"color" : white,
)
), false, true);
Parameters
| Name | Type | Description |
|---|---|---|
| $changes | Map |
A map to merge |
| $deep | Map |
Use deep merge |
| $overwrite | Map |
Overwrite the completly (cannot be used with deep) |
Require
- map-merge()
- $contexts
context-styles()
Prints contexts styles
File Information
- File: _color.scss
- Group: color
- Type: mixin
- Lines (comments): 178-179
- Lines (code): 181-187
Parameters
| Name | Type | Description |
|---|---|---|
| $name | String |
Name of context |
Require
all-context-styles()
Prints all context styles
File Information
- File: _color.scss
- Group: color
- Type: mixin
- Lines (comments): 233-240
- Lines (code): 242-251
Examples
@include ulu.all-context-styles();
Example of a color-context
<div class="color-context-dark" style="padding: 1rem">
Some text in dark context
</div>
Preview
Parameters
| Name | Type | Description |
|---|---|---|
| $with-prop | String |
Checks the specific context for a certain prop (has to be truthy)(used for output in helper/base color modules) |
Require
- context-styles()
- class()
- get()
- $contexts
all-color-class-styles()
Outputs all color classes
File Information
- File: _color.scss
- Group: color
- Type: mixin
- Lines (comments): 253-257
- Lines (code): 259-268
Examples
@include ulu.all-color-class-styles();
Example of a color-context
<span class="color-name">Some text</span>
Preview
Require
- class()
- get()
- $color-classes
Functions
get()
Get a color from the palette by name
File Information
- File: _color.scss
- Group: color
- Type: function
- Lines (comments): 102-104
- Lines (code): 106-123
Parameters
| Name | Type | Description |
|---|---|---|
| $name | String |
Name of color to get |
Returns
| Type | Description |
|---|---|
| Color | Note if non-string value is passed it is sent back through, along with custom properties ("var(..." and keywords inherit and transparent. This is by design so that you can always pass a user's colors through this (without having to check if it's a color value or a string [color palette]) |
Require
- require-map-get()
- $palette
exists()
Check if a color is set in the palette
File Information
- File: _color.scss
- Group: color
- Type: function
- Lines (comments): 132-132
- Lines (code): 134-137
Require
get-context()
Get a context by name
File Information
- File: _color.scss
- Group: color
- Type: function
- Lines (comments): 155-157
- Lines (code): 159-161
Parameters
| Name | Type | Description |
|---|---|---|
| $name | String |
Name of context |
Returns
| Type |
|---|
| Map |
Require
- require-map-get()
- $contexts
get-context-value()
Get a context's value'
File Information
- File: _color.scss
- Group: color
- Type: function
- Lines (comments): 163-166
- Lines (code): 168-176
Parameters
| Name | Type | Description |
|---|---|---|
| $name | String |
Name of context |
| $prop | String |
The property to get |
Returns
| Type |
|---|
| Color |
Require
tint()
Tint (add white) a color using the default white by a percentage
File Information
- File: _color.scss
- Group: color
- Type: function
- Lines (comments): 189-194
- Lines (code): 196-198
- Author:
Parameters
| Name | Type | Description |
|---|---|---|
| $color | Color, String |
Color/palette color name to apply to tint |
| $percentage | Number |
Percentage |
Returns
| Type |
|---|
| Color |
Related Links
Require
css-tint()
Tint (add white) a color using the default white by a percentage (Using color-mix)
- This only works in modern browsers (as of June 2025)
- These match ulu.color-tint() and are designed to accept the same arguments with the same results
File Information
- File: _color.scss
- Group: color
- Type: function
- Lines (comments): 200-205
- Lines (code): 207-209
Parameters
| Name | Type | Description |
|---|---|---|
| $color | Color, String |
Color or custom property to apply mix to |
| $percentage | Number |
Percentage |
Returns
| Type |
|---|
| Color |
Require
shade()
Shade (add black) a color with the default black by a percentage
File Information
- File: _color.scss
- Group: color
- Type: function
- Lines (comments): 211-216
- Lines (code): 218-220
- Author: Kitty Giraudel
Parameters
| Name | Type | Description |
|---|---|---|
| $color | Color, String |
Color/palette color name to shade |
| $percentage | Number |
Percentage to shade |
Returns
| Type |
|---|
| Color |
Related Links
Require
css-shade()
Shade (add black) a color using the default white by a percentage (Using color-mix)
- This only works in modern browsers (as of June 2025)
- These match ulu.color-shade() and are designed to accept the same arguments with the same results
File Information
- File: _color.scss
- Group: color
- Type: function
- Lines (comments): 222-227
- Lines (code): 229-231
Parameters
| Name | Type | Description |
|---|---|---|
| $color | Color, String |
Color or custom property to apply mix to |
| $percentage | Number |
Percentage |
Returns
| Type |
|---|
| Color |