Palette
A palette of eight pastel colors, plus black, white and grays, used solid or glazed. This page lists them; the next pages of this section explain how to use them.
View on GitHubAccessibility: every combination meets WCAG 2.2 AA, and most of them reach AAA. The details are at the end of the page.
Palette
| Color | Name in the classes | Pastel | Text color (light mode) |
|---|---|---|---|
| Sky | sky |
#5CDFEB |
#02464B |
| Blue | blue |
#8AB4FF |
#003290 |
| Lavender | lavender |
#B9A3FF |
#5F23B8 |
| Pink | pink |
#FFA6D1 |
#940061 |
| Peach | peach |
#FFB98A |
#5F2E01 |
| Lemon | lemon |
#FFE38A |
#4B3B01 |
| Mint | mint |
#8BE3B6 |
#014A2F |
| Coral | coral |
#FF9B9B |
#9C0226 |
In dark mode, the text color is the pastel itself.
Black, white and grays
The same grays that the framework already uses, in a scale like Bootstrap's. They are used with the same classes as the pastels.
| Color | Value | Text on the solid color |
|---|---|---|
white |
#ffffff |
black |
gray-100 |
#f5f5f7 |
black |
gray-200 |
#e8e8ed |
black |
gray-300 |
#d2d2d7 |
black |
gray-400 |
#aeaeb2 |
black |
gray-500 |
#8e8e93 |
black |
gray-600 |
#636366 |
white |
gray-700 |
#48484a |
white |
gray-800 |
#3a3a3c |
white |
gray-900 |
#1d1d1f |
white |
black |
#000000 |
white |
Scales
Each color has 13 tones, from 025 (almost white) to 975 (almost black), calculated from its pastel: same hue, different lightness. The tone marked ★ pastel is the pastel and Aa text is the text tone in light mode. Under each tone, its contrast on white (□) and on black (■): 4.5 or more is valid for text.
They are CSS variables, like Bootstrap's colors: var(--gm-sky-500), var(--gm-coral-800), var(--gm-gray-050)… There are no classes for each tone, so the file stays small.
--gm-sky-…--gm-blue-…--gm-lavender-…--gm-pink-…--gm-peach-…--gm-lemon-…--gm-mint-…--gm-coral-…--gm-gray-…How to use them
Each color is used with these classes:
- Colors: the text in a color, with
.gm-text-sky. - Background: a solid background, with
.gm-bg-sky. - Light and dark mode: light or dark mode in one part of the page, with
data-theme. - Theme: solid, glazed or text in one go, with
.gm-theme-skyand.gm-theme-solid,.gm-theme-glassor.gm-theme-text.
CSS variables
Each color has three variables, so you can use it in your own CSS:
--gm-sky: #5cdfeb; /* the pastel */
--gm-sky-rgb: 92 223 235; /* the same color in RGB channels, for transparency */
--gm-sky-text: #20747b; /* the text tone (the pastel itself in dark mode) */The glass values are variables too: --gm-glass-alpha, --gm-glass-border-alpha, --gm-glass-radius, --gm-glass-blur and --gm-glass-shadow.
Accessibility
| Use | Contrast | Level |
|---|---|---|
| Black text on the solid color | 7.8:1 to 13.3:1 | AAA |
| Text on glass (light and dark) | about 14:1 | AAA |
| Colored text, dark mode | 9.7:1 to 16.6:1 | AAA |
| Colored text, light mode (tones 800 and 900) | 7:1 or more | AAA |
| Text on the grays (solid) | 7:1 or more, except gray-500 (5.2:1) and gray-600 (6:1) |
AAA (those two, AA) |
Gray text (.gm-theme-text) |
7:1 or more | AAA |
- Never use white text on the solid pastel: it stays below 2.2:1.
- The glass border is soft. Cards, alerts and buttons with text don't need more, but form controls that are recognized by their outline (fields, checkboxes, switches) use the framework's gray border, which reaches 3:1.
- Don't show a state with color alone: success, warning and error always come with an icon or a text.
- Glass lets the background show through. Over a photo or strong colors, measure the contrast of the text where you use it.