← Colors in interface design

Using Slumber (#2D517C) in Interface Design: Scale, Buttons and Dark Mode

A working design system from Slumber #2D517C: a 50 to 950 scale, button states with contrast, a dark-mode version, an accessible link color and the CSS to paste in.

Slumber (#2D517C) is a dark, moderately saturated blue. As an interface color it has a clear personality: it is dark enough to carry white labels, which makes it a natural button and header color. This guide shows how to build a working interface from it: a full scale, every button state, a dark-mode version, a link color that passes, and the CSS to paste in.

A scale built from Slumber

A single color is not enough for an interface. You need lighter steps for surfaces and borders and darker steps for text and hover states. This 50 to 950 scale keeps the hue and saturation of Slumber and moves only the lightness. The step closest to Slumber keeps its exact value.

StepHexContrast on whiteBest text on it
50#F2F7FE1.07:1#111111
100#E2ECF91.19:1#111111
200#CADDF41.38:1#111111
300#A7C4E61.79:1#111111
400#81A4D02.57:1#111111
500#6389B83.62:1#111111
600#4E719C5.04:1#FFFFFF
700#2D517C8.14:1#FFFFFF
800#2B44629.97:1#FFFFFF
900#1E314913.20:1#FFFFFF
950#0E1B2C17.32:1#FFFFFF

Button states

Interactive elements need to look different when you hover, press and disable them, and each state still has to be readable. These values are made from Slumber itself, so the button stays in family.

StateBackgroundLabelLabel contrast
Default#2D517C#FFFFFF8.14:1
Hover#2A4C75#FFFFFF8.78:1
Pressed#27486E#FFFFFF9.38:1
Disabled#D0D3D9#6B72803.22:1

Disabled controls are exempt from WCAG contrast rules, but they still need to be recognizable, so the label is kept dark enough to read. For keyboard focus, use an outline of Slumber (#2D517C), which reaches 3 to 1 against a white page, the minimum for interface parts.

Dark mode

On a near-black page (#0F1115), Slumber reaches 2.32:1 (Fail). That is not enough for text, so lighten it. Bay View (#5A7FAE) is the closest lightness of the same hue that reaches 4.5 to 1.

Links and text

Slumber on white reaches 8.14:1 (AAA), so it can be a link and heading color as it is. Links also need a second cue beyond color, such as an underline, because some readers cannot tell the link color from the surrounding text.

Surfaces and borders

Tints of Slumber make quiet surfaces that feel connected to the brand without competing with it. Snow (#F8F9FA) works as a card or page tint, and Bride (#E5E7EA) as a border or divider.

The CSS

CSS variablescss
:root {
  --brand: #2D517C;
  --brand-hover: #2A4C75;
  --brand-active: #27486E;
  --on-brand: #FFFFFF;
  --brand-surface: #F8F9FA;
  --brand-border: #E5E7EA;
  --brand-text: #2D517C;
  --focus-ring: #2D517C;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #5A7FAE;
    --brand-text: #5A7FAE;
  }
}

A short checklist

  1. Use Slumber for the one action you most want people to take.
  2. Put #FFFFFF text on it and check that the ratio stays above 4.5 to 1.
  3. Use the scale for hover, pressed, border and surface colors rather than inventing new ones.
  4. Define a separate dark-mode value and test it on a dark page.
  5. Never use the color as the only signal: add an icon, a label or an underline.