Scroll-inked heading with highlights (view-timeline)
A large heading whose words turn from grey to ink as the page scrolls, then whose key phrases get a marker stroke, in pure CSS with a readable fallback.
- Tailwind
- React
- CSS
- WordPress
Description
The hero heading reads at scrolling pace: its words turn from grey to ink one after another while it crosses the screen, then each key phrase (here “ardoise naturelle”, “devis détaillé sous 48 heures”, “garantie décennale”) gets a marker stroke as soon as its last word is inked. Everything relies on a single CSS view-driven animation (view-timeline on the heading, animation-timeline on each word): no JavaScript, no IntersectionObserver. Only the background position is animated, with no reflow or layout shift; the heading stays a real h2, read in one go by screen readers, and highlighted phrases are real mark elements. The starting grey keeps AA contrast on the background and on the highlight, in light and dark mode. In browsers without scroll-driven animations, with prefers-reduced-motion, prefers-contrast: more or when printing, the heading is shown fully inked and highlighted at once; in forced-colours mode the highlight uses the Mark and MarkText system colours. Colours set with variables (--etsv-ink, --etsv-dim, --etsv-mark), reading zone with --etsv-start and --etsv-span, fluid size with no overflow at 360 px. Example: a roofer in Nantes.
Code
Loading the code…
The code of this component in
Archive contents
effet-texte-surligne-defilement-view-timeline-html-tailwind.zip3 files · 5 Ko
- index.html6 Ko
- README.md4 Ko
- LICENSE.md1 Ko
Tags
Updated on December 2, 2026.
Reviews
No reviews yet.
In the same spirit

Cards that fade in as they enter the screen, one after another in each row, without a line of JavaScript and with a static fallback.
- Tailwind
- React
- CSS
- WordPress

A translucent card with a saturated blur whose sharper edge refracts the colourful shapes drifting behind it, with an opaque fallback when transparency is reduced.
- Tailwind
- React
- CSS
- WordPress

A help block shaped like a conversation: bubbles, three animated typing dots and clickable quick replies that show your answers to frequent questions, frozen under prefers-reduced-motion.
- Tailwind
- React
- CSS
- WordPress

A paragraph whose words turn from grey to full ink, one by one, as the page scrolls, in pure CSS with a plain-text fallback.
- Tailwind
- React
- CSS
- WordPress