CSS has been steadily reclaiming control over visual interactions — styling, animation and accessibility alike — moving work off the JavaScript main thread and closer to the GPU. The browser engine handles the optimization; the result is code that is robust and accessible without leaning on libraries that may disappear tomorrow. The toolkit is broad: 3D, modern layout, clip-path, transforms, custom properties, scroll-driven animations, view transitions and @property — and almost anything can be animated, including to auto height. SVG is not new, but it supports entire sites built from illustration and animation; responsive, lightweight, accessible work driven mostly by CSS Grid plus SVG. An entire video game, UI included, can be built in SVG alone.
What follows is not a comprehensive guide but a selection of expressive techniques — the end of the spectrum where a site feels alive and gets remembered, rather than the simple satisfaction of a form that completes smoothly.
Deciding what motion is for
Movement should not happen merely because it can. Everything communicates, animations included, so movements have to be designed to support the intended message and kept tightly scoped. One way to do that is a keyword list that fixes intent before any CSS is written.
Take a project for a nature event centered on mushrooms. The design language flips entirely with the vibe: a “Psychedelic Mushroom Rave” and a “Spiritual Mushroom Retreat” built around ancestral medicine have almost nothing in common.
- Psychedelic event: saturated, high-contrast colors, illustration and distortion; fast, frantic, morphing, hypnotic movement synced to loops; a fun, chaotic, energetic feeling; funk and psych-rock typography; references to Pop Art, 60s/70s op art and rave flyers; dancing as the action; emojis and films such as Fear and Loathing in Las Vegas.
- Spiritual retreat: earth tones, desaturated photography, nature and whitespace; slow, fluid, breathing movement with subtle parallax and smooth scrolling; a calm, introspective, safe feeling; elegant serif or minimalist sans-serif type with wide, legible spacing; references to Scandinavian design, Wabi-sabi and spa aesthetics; breathing as the action; healing sounds and films such as Eat Pray Love.
The list also guides which properties get used and how, and it can be shared with the client so the direction is chosen together. The examples below assume the psychedelic option.
Splitting text
Text is split by character (or word, or line) to produce staggered effects; the GSAP SplitText plugin popularized the approach. Each letter of “Hola” is wrapped in a span, and each span gets an inline custom property indexing it in order.
<h1 class="reveal-text">
<span style="--i:0">H</span>
<span style="--i:1">O</span>
<span style="--i:2">L</span>
<span style="--i:3">A</span>
</h1>
That indexing step becomes far simpler once sibling-index() has broad browser support. For now, the custom property acts as a multiplier on an increasing animation-delay, staggering each span so characters fade in as they move up.
.reveal-text span {
animation: slideUp 0.6s ease-out forwards;
animation-delay: calc(var(--i) * 0.1s);
display: inline-block;
opacity: 0;
transform: translateY(3rem);
}
@keyframes slideUp {
to {
opacity: 1;
transform: translateY(0);
}
}
Accessibility is where this gets hard. The instinct is to mark every span aria-hidden="true" and add a visually hidden copy of the full word for screen readers:
<h1>
<span class="sr-only">HOLA</span>
<span aria-hidden="true" class="reveal-text">
<span style="--i:0">H</span>
<span style="--i:1">O</span>
<span style="--i:2">L</span>
<span style="--i:3">A</span>
</span>
</h1>
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
That pattern does not guarantee a good result. Adrian Roselli tested GSAP's SplitText across eight screen reader and browser combinations and found it correct in only two, so any shipped use of the technique needs testing with real assistive technology. If that risk is too high, Preethi's alternative is worth knowing: letter-spacing accepts negative values that collapse characters on top of each other, hiding them without touching the DOM; animating back to 0 gives a similar reveal with no accessibility overhead. A ::nth-letter pseudo-selector, targeting glyphs the way ::first-letter targets the first, would be ideal — but it does not exist yet. Every animation should also honor motion preferences:
@media (prefers-reduced-motion: reduce) {
.reveal-text span {
animation: none; /* or a softer animation */
}
}
The technique gets unwieldy with long text and many different animations. Splitting text with SMIL was tried for the psychedelic site, but proved verbose — animating just two letters takes this much:
<svg role="img" aria-label="TODOS LOS HONGOS" viewBox="0 0 1366 938.96">
<title>TODOS LOS HONGOS</title>
<g aria-hidden="true">
<text transform="rotate(-9.87 2181.107 -1635.1)" opacity="0">T
<animate attributeName="dy" values="100; -20; 0" keyTimes="0; 0.8; 1" dur="0.4s" begin="0s" fill="freeze"/>
<animate attributeName="opacity" from="0" to="1" dur="0.01s" begin="0s" fill="freeze"/>
</text>
<text transform="rotate(-8.92 2372.854 -2084.755)" opacity="0">O
<animate attributeName="dy" values="100; -20; 0" keyTimes="0; 0.8; 1" dur="0.4s" begin="0.1s" fill="freeze"/>
<animate attributeName="opacity" from="0" to="1" dur="0.01s" begin="0.1s" fill="freeze"/>
</text>
<!-- rest of letters... -->
</g>
</svg>
Adding role="img" and a <title> to the <svg>, and wrapping individual letters in <g aria-hidden="true">, gives screen readers one clean label — though again, results vary by combination, so critical text should not be animated at all. For longer text, a library like GSAP offers more control, with the same accessibility caveats and inconsistent screen reader results:
<h1>
<span class="splitfirst">Todos los hongos son</span>
<span class="splitlast">mágicos</span>
</h1>
const splitFirst = SplitText.create('.splitfirst', {
type: "chars",
});
const splitLast = SplitText.create('.splitlast', {
type: "chars, lines",
mask: "lines"
});
const tween = gsap.timeline()
.from(splitFirst.chars, {
xPercent: 100,
stagger: 0.1,
opacity: 0,
duration: 1,
})
.from(splitLast.chars, {
yPercent: 100,
stagger: 0.1,
opacity: 0,
duration: 1,
});
That slower fade would have suited the retreat option; the text feels serene as it arrives.
Clipping and masking
clip-path and mask both hide parts of an element but on different principles. Clipping is binary — pixels are fully visible or completely gone — which suits clean geometric shapes, polygons, circles or SVG paths, and lets the browser render more efficiently. Masking works through luminance or alpha: white reveals, black hides, and anything in between yields partial transparency, making it the tool for soft edges, gradient fades and irregular textures. A very complex vector shape may still perform better as a mask than as a vector clip-path; Sarah Drasner has a write-up on choosing between them.
The project is a clear clip-path case. A circle starts at clip-path: circle(0%) — a clipping circle of zero radius, so nothing shows — and expands to circle(100%) over the animation, revealing the element as it grows from the center, with opacity handling the fade:
#rainbow, #floor, #mushroom, #flores {
opacity: 0;
animation: maskAnim 2s ease-in forwards;
}
@keyframes maskAnim {
0%, 1% {
clip-path: circle(0%);
opacity: 1;
}
100% {
clip-path: circle(100%);
opacity: 1;
}
}
The 1% keyframe ensures the browser interpolates clip-path from circle(0%) rather than from whatever value the element already has; without it, some browsers jump at the start. animation-fill-mode: both is a cleaner fix, locking the element into its from state before the animation begins. The same animation is then applied to the different SVG groups in the illustration:
<g id="rainbow">...</g>
<g id="floor">...</g>
<g id="mushroom">...</g>
<g id="flowers">...</g>
Driving animation with scroll
Scroll-driven animations tie an animation's progress to scrolling rather than to a timeline that plays and stops, which suits subtle, trippy movement like light parallax: nearer objects move faster than distant ones. The CSS:
#estrellas, #arcoiris, .text-line, #fecha, #arco, #flores, #dir, #piso, #barras {
animation: moveUp both;
animation-timeline: view();
}
@keyframes moveUp {
from { transform: translateY(var(--offset)); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
#estrellas { --offset: 10vh; }
#arcoiris { --offset: 20vh; }
#fecha { --offset: 45vh; }
#arco { --offset: 50vh; }
#dir { --offset: 50vh; }
#flores { --offset: 65vh; }
#piso { --offset: 85vh; }
#barras { --offset: 90vh; }
animation-timeline: view() starts the animation as the element enters the scrollport and completes it as the element leaves. Different velocities come from placing elements at different offsets, using an indexed --offset custom property in the same way text splitting was indexed.
Depth, cursors and restraint
The 3D transform technique is the trickiest and needs a performance eye. Tools such as Layoutit can carry some of the load — it has voxels and terrain generators built entirely in CSS 3D — and combines with VoxCSS, a voxel engine that renders 3D cuboids from CSS Grid layers and transforms, without Canvas or WebGL. Combining scroll and 3D effects supports the “hypnotic” and “dancing” entries from the keyword list: a scene is given depth with perspective, and children are placed in 3D space with transform-style: preserve-3d so each image rotates and translates along the z-axis. Connecting that to a scroll-driven animation using transform: rotateY:
.scene {
perspective: 1200px;
}
.img-wrapper {
transform-style: preserve-3d;
animation: rotateImg linear;
animation-timeline: scroll();
> img {
transform: rotateY(270deg) translate3d(0, 50px, var(--distance));
}
> img:nth-child(2) {
transform: rotateY(180deg) translate3d(0, 50px, var(--distance));
}
}
/* etc. */
@keyframes rotateImg {
to { transform: rotateY(360deg); }
}
cursor may be among the least-used CSS properties, and there are many cursor types to pick from, though how far to take customization is debated. Different containers can show different cursors on hover; SVG and PNG are the preferable formats for transparency, although any raster image works. Sizes are inconsistent across browsers: Firefox caps custom cursors at 32×32px while Chrome allows up to 128×128px, and most browsers either refuse or downscale anything larger than 32×32px on high-DPI screens — so 32×32px is the safe choice.
.box1 {
cursor: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAZCAMAAAD63NUrAAAACVBMVEX///8AAAD///9+749PAAAAAXRSTlMAQObYZgAAAFZJREFUeNqdzksKwDAIAFHH+x+6lIYOVPOhs5OHJnES/5UkYKEkU7xjijSIm50iFh4fAXgYDd/yumVVRSwsqq/nRA3xVK0oo06d5U6DpQZ7PV7lMxH7LkaQAbYFwryzAAAAAElFTkSuQmCC),auto;
}
Multiple fallbacks widen support:
body {
cursor: url('path-to-image.png'), url('path-to-image-2.svg'), url('path-to-image-3.jpeg'), auto;
}
Changing default web behavior this way carries accessibility weight, so custom cursors are best applied to very specific elements rather than wholesale across a site.
Anchor positioning for hover effects
CSS Anchor Positioning, as shown in a Kevin Powell demo, lets a single pseudo-element be attached to whichever item is currently hovered, instead of defining a pseudo-element on every item. One element gets anchored to the hovered target — useful for things like highlighting cards.
The approach also makes it possible to transition the hover state from one card to the next. The linear() function, with curves generated through Easing Wizard, produces a natural bounce for that movement.
Where this leaves us
The technical barriers to building memorable web experiences have largely disappeared. Modern CSS features remove the need for additional JavaScript, so the available options are broader than ever without the complex technical overhead of the past.
That shifts the question from is this possible? to does this movement tell a better story? If the answer is yes, ship it — and use these tools because they help tell a better story, one that is also accessible and performant, not simply because they exist.
Everything covered here is only a handful of the ways to get there.



