Loading video...
Video Failed to Load
CSS Trick 📜 You can trigger text highlights on scroll with scroll-driven animations 😎 mark { animation: highlight; animation-timeline: view(); } @keyframes highlight { to { --lit: 1; }} mark span { background-position: calc(var(--lit) * -110%) 0; transition: background 1s; } The trick is using a scroll-driven animation to... show more
208,112 views • 2 years ago •via X (Twitter)
10 Comments

jhey ▲🐻🎈2 years ago
Here's that @CodePen link 🫶 Should be good in all browsers 🤙 No CSS scroll animation support? Falls back to Intersection observer ✨

Arif Sardar2 years ago
Indeed I like the way you toggle the theme much more than the highlight.

jhey ▲🐻🎈2 years ago
@Code_With_Arif Teaser for the next demo/video coming up 🫶😎

Ryan2 years ago
Codepen link?

tsúbomi2 years ago
this makes reading easy for users.

Aryan2 years ago
This is some. crazy CSS love it

Madat Bayramov2 years ago
Really wish X to add possibility to have code snippet in the posts. Readability is a way too low in such posts

Andre Specht2 years ago
Are scroll-driven events available on the main browsers?

An Vo2 years ago
@HienHuuPham Amazing

ed2 years ago
Would love to see a codepen link on this. Any chance you can share, please?
