How the Text Shadow Generator Builds a Value
CSS text-shadow paints one or more shadows behind text. Each shadow is written as “offset-x offset-y blur-radius? color?”, and multiple shadows form a comma-separated list applied FRONT-TO-BACK — the first-listed shadow sits on top. This generator’s engine (textShadowEngine.ts) holds the effect as a typed list of layers (each an offset-x, offset-y, blur and a colour string with optional alpha) and serialises the exact comma-separated value the spec defines, so the preview and the copied CSS always match. Blur is clamped to zero or positive because the spec forbids negative blur.
- Each layer: offset-x, offset-y, blur-radius, colour (with optional alpha)
- Multiple shadows paint front-to-back — the first-listed shadow is on top
- Negative offset-x moves the shadow left; negative offset-y moves it up
- blur-radius must be ≥ 0; the engine clamps it
- Pure and deterministic — the same layers always emit the same value
