Components
← All components

Aspect Ratio

stimeo--aspect-ratio

Supplies a ratio as a CSS custom property so consumer styles keep the box proportional.

The stimeo--aspect-ratio controller is a pure layout helper with no role or state. It supplies the requested ratio as the --stimeo-aspect-ratio custom property on the host, so consumer CSS can drive the box with aspect-ratio: var(--stimeo-aspect-ratio) (or a padding-hack fallback). The value accepts the CSS ratio forms 16/9 and a bare number; it is normalized to w / h and an unparseable value falls back to 1 / 1, and the reflection re-runs whenever the value changes. Behavior only — the drawing itself (aspect-ratio, object-fit, cropping) stays in this Playground's stylesheet.

running
16 / 9
16 / 9 (widescreen)
1 / 1
1 / 1 (square)
3 / 4
3 / 4 (portrait)