Tool guide / Color and CSS

Build a color palette and responsive CSS

A small design system needs a few dependable pieces: a color scale, accents that suit it, readable text colors, and sizes that respect the reader's font settings. Each example below is calculated by the same code that runs the tools, in your browser.

1. Turn one brand color into a scale

The Color Palette Generator builds steps from 50 (lightest) to 950 (darkest). It keeps the hue and adjusts perceived lightness in OKLCH, so neighbouring steps look evenly spaced. Your exact color stays in the scale at the closest step.

50#EFF8FF100#D5EEFE200#B2DEFC300#85C7F1400#59A9DB500#2B86B8600#1175A6700#005D87800#004667900#00324B950#001D2E

Use light steps (50–200) for backgrounds, middle steps (400–600) for buttons and links, and dark steps (700–950) for text and borders. Export the scale as CSS variables, SCSS, JSON, or a Tailwind colors object.

2. Pick accents with color harmonies

Harmonies rotate the hue around the color wheel while keeping lightness and saturation. Complementary sits opposite (180°), analogous colors sit beside it (±30°), and triadic colors are spaced evenly (120°). From #2B86B8, the triadic accents are:

primary: #2B86B8
primary-accent-1: #B25F7D
primary-accent-2: #78862E

Keep one color dominant and use accents sparingly, for highlights, charts, or status.

3. Check text contrast

WCAG AA asks for a 4.5:1 contrast ratio for body text and 3:1 for large text and interface parts. The palette shows each swatch's best contrast against white or black text; the Color Contrast Checker tests any pair and suggests the nearest passing color. In this scale, step 500 reaches 4.03:1 against white.

4. Gradients and shadows

The CSS Gradient Generator writes linear, radial, and conic gradients with a solid fallback first:

background: #2B86B8;
background: linear-gradient(135deg, #2B86B8 0%, #B0E0FF 100%);

Soft elevation usually looks better as two or more shadow layers than as one dark one. Negative spread keeps a large blur close to the element. The CSS Box Shadow Generator previews layers and also writes a Tailwind class:

box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.24), 0 4px 8px -4px rgba(15, 23, 42, 0.1);
shadow-[0_12px_32px_-8px_rgba(15,23,42,0.24),0_4px_8px_-4px_rgba(15,23,42,0.1)]

5. Use rem for sizes

A rem is the root font size, which is 16px unless the reader changes it. Sizes in rem grow with that setting, so text stays readable for people who enlarge it.

PixelsREMPoints
12px0.75rem9pt
14px0.875rem10.5pt
16px1rem12pt
18px1.125rem13.5pt
20px1.25rem15pt
24px1.5rem18pt
32px2rem24pt
48px3rem36pt

The PX to REM Converter rewrites a whole stylesheet, leaves URLs, strings, and comments alone, and can keep hairline values such as 1px borders:

.card {
  padding: 1.5rem 2rem;
  border: 1px solid #D2D8DA;
  font-size: 1.125rem;
}

6. Fluid sizes with clamp()

clamp(minimum, preferred, maximum) lets a size scale with the viewport between two limits, without media queries. A heading that grows from 28px on a 360px screen to 48px at 1280px:

font-size: clamp(1.75rem, 1.2609rem + 2.1739vw, 3rem);

Mixing rem into the preferred value keeps the size responsive to the reader's font setting as well as the screen width.

Related tools

Convert individual colors between HEX, RGB, and HSL with the Color Converter, and shrink stylesheets with the CSS Minifier. These design tools also run in the Mer Tools extension. All tools are free; optional donations support development.