Jolty UI Jolty UI Documentation Icons Colors

Colors

Palette

Each palette contains 12 colors that are used for various UI elements.

gray

--gray-hue:
1
2
3
4
5
6
7
8
9
10
11
12
gray
gray alpha
gray dark
gray dark alpha

accent

--accent-hue:
1
2
3
4
5
6
7
8
9
10
11
12
accent
accent alpha
accent dark
accent dark alpha

info

--info-hue:
1
2
3
4
5
6
7
8
9
10
11
12
info
info alpha
info dark
info dark alpha

success

--success-hue:
1
2
3
4
5
6
7
8
9
10
11
12
success
success alpha
success dark
success dark alpha

danger

--danger-hue:
1
2
3
4
5
6
7
8
9
10
11
12
danger
danger alpha
danger dark
danger dark alpha

warning

--warning-hue:
1
2
3
4
5
6
7
8
9
10
11
12
warning
warning alpha
warning dark
warning dark alpha

You can use the CSS variable --{name}-hue to change the color hue.

:root, ::backdrop {
  --gray-hue: 267;
}

Also, you can use the data-ui-palette="{name}" attribute to add color CSS variables to the element, which are already added to the root element.

This is useful when you want to change the hue of the color palette for a specific element.

Steps

The gray palette contains a specific --gray-0 shade, which is used for the main background of the site.

Backgrounds: 1-2

1
2

Used for the background of the site and containers.

Highlights: 3-5

3
4
5

Used for highlights and accents.

Borders: 6-8

6
7
8

Used for borders and dividers.

Solid backgrounds: 9-10

9
10

Used for the background of buttons and control elements.

Text: 11-12

11
12

Used for text and icons.

Usage

To use colors in CSS, use variables like var(--gray-11). To use colors with an alpha channel, use variables like var(--gray-a11).

.my-button {
  background-color: var(--accent-a2);
  color: var(--accent-a11);
}
.my-button:hover {
  background-color: var(--accent-a3);
}
.my-button:active {
  background-color: var(--accent-a4);
}

The gray palette also has variations for dark var(--gray-11-dark) and light var(--gray-11-light) themes.

Themes

All colors support light and dark themes.

If you want to use only the light theme, add the data-ui-mode="light" attribute.

If you want to use only the dark theme, add the data-ui-mode="dark" attribute.

If you want to invert the theme, add the data-ui-mode="reverse" attribute.

2024 © A Project by Anatolii Moldovanov