CSS tools: colors, gradients, shadows, rem

These tools turn a design decision into CSS you can paste: a brand color in the format a stylesheet needs, a palette with readable text on it, a gradient, a shadow, a size in rem.

The color converter reads any CSS color and writes it as hex, rgb(), hsl() and oklch(), and checks two colors against WCAG. The palette generator builds harmonies and a Tailwind-style 50-to-950 scale from one color, with the contrast of each step. The gradient and box-shadow generators write the declaration and show it live, the px-to-rem converter works at any root size, and the CSS formatter and SVG optimizer tidy what you already have.

The gotchas are mostly about what the browser does with your numbers. A contrast of 4.49:1 fails the 4.5:1 AA threshold, even though it rounds to 4.5, so the palette generator never rounds a ratio up. Sizes in rem follow the font size a reader sets in their browser, while px ignores it, which makes rem the kinder default for text. And interpolation matters: a gradient from blue to yellow through sRGB turns gray in the middle, where in oklch stays vivid.

To practice, Flexbox Yard and CSS Selectors teach flexbox layout and selectors, and the Hex Color game trains your eye for color codes.

The tools

Learn it by playing

Answers