GitHub, 7 stars
Light themes
Dark themes

Make your own

CSS, design tokens and themes

Design tokens, themes, contrast, forced colours, print, fluid type, a sliding pill, touch targets, an icon sprite and a self-hosted font, in plain CSS.

CSS and themes

Design tokens in plain CSS custom properties

Design tokens as CSS custom properties in one file: colour, type, space, shape and motion, how components read them, and the same tokens for Tailwind and Figma.

Vladyslav KorzhMaintains Tray UI6 minutes to read

More articles

11 more, newest first.

CSS and themes, 7 minutes

Forced colours mode in CSS: fills become edges

How Windows High Contrast and other forced colour modes repaint a page, and the CSS that keeps cards, chosen items, icons and focus rings visible.

CSS and themes, 6 minutes

Print styles for a web app with @media print

A print stylesheet for a web app: the light theme on paper, the navigation left out, link addresses, page breaks, tables, and the fills that must still print.

CSS and themes, 6 minutes

Ten themes from one stylesheet with data-theme

Ten colour themes in one CSS file: each a rule of custom properties on data-theme, with color-scheme, the system's dark setting, and a theme inside a theme.

CSS and themes, 7 minutes

Fluid type with clamp() that grows with zoom

Why a clamp() font size made of vw alone ignores browser zoom and text size, what a rem part changes, and how to check fluid headings against WCAG 1.4.4.

CSS and themes, 6 minutes

Testing colour contrast in every theme

Test WCAG colour contrast in every theme automatically: rules for token pairs measured in Node, then the text of real pages measured on its ground in a browser.

CSS and themes, 6 minutes

Segmented control with a sliding pill in CSS

A segmented control on radio inputs, with a pill that slides to the choice in CSS or a little script, and stays still for reduced motion and forced colours.

CSS and themes, 7 minutes

CSS prefers-contrast: more, one grey step up

Answer prefers-contrast: more in CSS by moving each grey token one step towards the ink and giving fills an edge, then test it in DevTools and Playwright.

CSS and themes, 7 minutes

44px touch targets without bigger buttons

Give a small button a 44 pixel hit area with a positioned ::before, see what WCAG 2.5.8 and 2.5.5 ask, and measure the area with elementFromPoint.

CSS and themes, 6 minutes

An SVG icon sprite inside one script

Build an SVG sprite of symbol elements from a script, draw each icon with use and currentColor, hide it from screen readers and flip arrows right to left.

CSS and themes, 7 minutes

Self-hosting a web font with one woff2 file

Self-host a variable font from one woff2 file: the @font-face rule, font-display, a preload with crossorigin, CORS for other sites and the OFL licence.

CSS and themes, 9 minutes

Generate an accessible colour theme from four colours

Derive every colour token of a theme from a page, a tray, an ink and an accent: greys mixed in OKLab, each placed by its contrast, then checked against WCAG.

New articles in a feed

Add the Atom feed to a feed reader, and each new article comes to you whole, with its code.

Open the feed

GitHub7 stars

↑↓ to moveEnter to openEsc to close