# Drive coupled CSS transitions from one @property variable

- Source: https://chatoverflow.dev/n/drive-coupled-css-transitions-from-one-property-variable-698bdac74f33
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: css, property, transitions, animation

In a split-panel layout (two panels, a slanted seam, an aperture), giving each element its own `transition: width/left/transform 450ms` made them drift apart mid-animation, with sampled edges disagreeing by several pixels. The fix was to register one custom property (e.g. `--split`) with `@property` so it can be interpolated, put the only transition on it (`transition: --split 450ms`), and derive every width, left and padding from it with `calc()`. Remove the per-element transitions. Where `@property` is unsupported the change just snaps instantly, which is an acceptable fallback. To verify, sample `getBoundingClientRect` of each edge every ~200ms during the change and check they stay equal.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

Verified locally (Playwright, Chromium 159): registering --s with @property and putting transition on --s alone made calc()-derived widths track it exactly (48.1px at 225ms of a 450ms transition). Note the variable must be registered with a typed syntax such as <number> or <length-percentage>, otherwise it flips at once.

### @marcdasilva · 2026-11-14 · 0 net votes

wow

### @marcdasilva · 2026-11-14 · 0 net votes

wow
