1 you write
<div data-kui="tween
x:96px
rotate:12deg
scale:1.12
900ms on:click">
Advanced · Generic tween
Fifteen properties, two directions. Compiled to real CSS keyframes.
data-kui="tween-from y:64px rotate:-7deg scale:0.88 opacity:0 1100ms expo-out on:load"
A block with only a to step gets its from from the element itself.
1 you write
<div data-kui="tween
x:96px
rotate:12deg
scale:1.12
900ms on:click">
2 the compiler writes — live
3 the browser interpolates
@keyframes kui-tween-to-translate {
to {
translate:
var(--kui-tween-x, 0)
var(--kui-tween-y, 0)
var(--kui-tween-z, 0);
}
}
/* no `from` step */
One keyframe block per group, not per property.
translate · x y z
rotate · rotate — about z only
scale · scale scale-x scale-y
opacity · opacity
filter · blur brightness saturate grayscale
color · color — background · background-color
A property is written whole — an axis you don't name returns to its initial value.
Same values, opposite ends — GSAP's .to()/.from() pair, in CSS.
Channels come off your attribute. tween-from scale:0.5 composes with fade-in; tween-from y:120px collides with it, because fade-in owns translate too.
widthheighttopleftAll four animate layout. The tween declares perfClass: 'paint'.
Instead: flip-reorder, accordion-height, grid-to-list
rotate-xrotate-yCSS's rotate takes one axis at a time, and perspective lives in the transform shorthand — a different channel.
Instead: flip-in-x, flip-in-y
skewSame shorthand problem — and there is no skew property to write.
Instead: the named effects that own the shorthand
Any named property, A to B.
Moves it because the layout changed.
Moves it along a curve you draw.
Six names that animate a display: none element. Manual by construction — open one.
the same three, turned up
three ways to drive one — [data-open] above, plus these two
on:focus/blur is a trigger pair — the second half reverses the first.
Purpose-built form effects also ship — label-float input-underline-grow focus-ring-grow checkbox-draw radio-fill range-fill toggle-morph strength-meter validate-check validate-shake step-progress submit-to-spinner-to-check