# CSS, design tokens and themes

> Part of Tray UI 0.4.1, a design system in plain HTML and CSS (MIT licence). Every page: https://trayui.com/llms.txt

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.

- [Design tokens in plain CSS custom properties](https://trayui.com/articles/design-tokens-css.md), 18 November 2026: 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.
- [Forced colours mode in CSS: fills become edges](https://trayui.com/articles/forced-colors-mode.md), 18 November 2026: 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.
- [Print styles for a web app with @media print](https://trayui.com/articles/print-styles-web-app.md), 18 November 2026: 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.
- [Ten themes from one stylesheet with data-theme](https://trayui.com/articles/themes-one-stylesheet.md), 18 November 2026: 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.
- [Fluid type with clamp() that grows with zoom](https://trayui.com/articles/fluid-type-clamp-zoom.md), 18 November 2026: 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.
- [Testing colour contrast in every theme](https://trayui.com/articles/contrast-testing-themes.md), 18 November 2026: 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.
- [Segmented control with a sliding pill in CSS](https://trayui.com/articles/segmented-control-pill.md), 18 November 2026: 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 prefers-contrast: more, one grey step up](https://trayui.com/articles/prefers-contrast-more.md), 18 November 2026: 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.
- [44px touch targets without bigger buttons](https://trayui.com/articles/touch-targets-44px.md), 18 November 2026: 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.
- [An SVG icon sprite inside one script](https://trayui.com/articles/svg-icon-sprite.md), 18 November 2026: 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.
- [Self-hosting a web font with one woff2 file](https://trayui.com/articles/self-host-web-font.md), 18 November 2026: 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.
- [Generate an accessible colour theme from four colours](https://trayui.com/articles/colour-theme-from-four-colours.md), 17 November 2026: 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.
