Repository navigation
3.1.0
✨ Features
- Finite laps:
iterationsandonComplete. Giveiterationsa number of laps (2, or0.5for half a lap;'infinite'stays the default) and the border runs that many times, then stops exactly where its last lap ends, with no jump back.onCompletefires once at that moment. A border can now mark an event — a job that started, a save that went through — and then step aside. Run it again by togglingshoworanimate, or with a newkey. Thedrawvariant transitions instead of looping, so it ignores both. New demo: Finite Laps. respectReducedMotionprop.truekeeps the border still for people who ask their system to reduce motion, whatever the theme says;falsekeeps it moving; left unset it followstheme.respectReducedMotion, exactly as before. A still beam rests whereprogressputs it (the same picture asanimate={false}), and a finite run callsonCompleteright away instead of leaving it waiting.- A multicolour comet.
colorStopsnow colour the comet's tail: position 0 is the head, 100 the end of the tail, and the colours travel with the comet while it fades out.
⚡ Improvements
- Free while off-screen. A border with the default
trigger="always"now pauses while it is scrolled out of the viewport, and when it comes back it catches up on the time it missed, so it is exactly where it would have been: borders staggered withphasestay in step. Browsers do not do this on their own — measured in Chrome, 12 off-screen rings kept costing 230–1400 ms of main-thread time every 10 seconds; paused, nothing. A finite run (seeiterations) is never paused, so itsonCompletenever waits for a scroll. - A smoother wedge. The default
beamMode="wedge"is now a bell of brightness: it fades in and out with no visible edge, while its colour runs fromcolorFromat the back tocolorToat the front. Its width at half brightness is the same as before, sospreadkeeps meaning what it did.
🐛 Bug Fixes
- Under reduced motion (
theme.respectReducedMotion), the dot and the wedge now rest atprogress, likeanimate={false}; they used to sit at the start of the path.
🛠️ Other
--border-animate-beam-start,-from,-toand-endare deprecated and no longer read: the wedge's stops come fromspreadthrough the new--border-animate-beam-stops. They stay in the CSS variables type, sovarsoverrides written for 3.0 still compile.- New CSS variables:
--border-animate-iterationsand--border-animate-beam-stops.
What's Changed
- ✨ Beam: pause off-screen, finite laps, reduced motion per component, a continuous tail (#57) by @gfazioli in #58
Full Changelog: 3.0.14...3.1.0