_ui

A CSS system in 7 properties, 7 functions, and 9 layers.

Install
<link rel="stylesheet" href="css/_ui-v4.css">
Usage
--_color: oklch(50% 0.2 270); /* set a color — full palette out */ --_type: 3; /* set a number — full typography out */ gap: --space(2); /* fluid spacing that scales */
Engine

Three orthogonal systems. Each takes one input. Everything else derives.

Color

Set --_color. Get surfaces, fills, text, borders, shadows — light and dark.

5 functions 2 properties

Type

Set --_type. Get fluid size, tightened tracking, compressed leading.

1 function 1 property

Space

Call --space(step). Fluid geometric rhythm from the same engine as type.

1 function same config
Properties
PropertyTypeDefaultPurpose
--_color<color>purplepalette source
--_dark0 | 10light/dark mode
--_bg<color>whitecurrent background (for contrast)
--_type<number>-999type scale step (sentinel = inactive)
--_motion0 | 11animation toggle
--_type-scale<number>1global type multiplier
--_space-scale<number>1global space multiplier
Functions
FunctionReturnsPurpose
--surface(level)<color>background at perceptual depth
--fill(level)<color>interactive color, full chroma
--contrast(amt, bg)<color>text for any bg, auto direction
--alpha(a, base)<color>transparency
--shadow(level)<shadow>colored depth
--type(step)<length>fluid geometric font size
--space(step)<length>fluid geometric spacing
Layers
reset CSSWG corrections
props static design constants
theme brand config, fluid scale settings
color OS prefs, user prefs (data-ui-*)
typography type system, element defaults
composition layout primitives
layout page-level semantic regions
components card, button, inputs, popover
overrides responsive, a11y, print
User Preferences
AttributeValuesEffect
data-ui-schemelight · darkforce color scheme
data-ui-motionnonedisable transitions
data-ui-sizesmall · largescale all type
data-ui-densitycompact · comfortablescale all spacing

Settings
Color
Scheme
Size
Density
Motion