Loading video...
Video Failed to Load
Future CSS Tip! 📜 You can use scroll-driven animations like JavaScript's IntersectionObserver to animate highlights ✏️ mark { animation-name: highlight; animation-timeline: view(); } @keyframes highlight { to { --light: 1; }} mark span { background-position: calc((1 - var(--light)) * 110%) 0; transition: background 1s; } The "trick" is to... show more
257,525 views • 2 years ago •via X (Twitter)
12 Comments

Here's that @CodePen link! 🚀 Remember, you need to be in Chrome to see this in action 🤙 Then you'll get the highlighting and the cool View Transition effect 😎

Discover the top Safari web extensions to boost productivity, enhance workflow, and customize your browsing experience on Mac, iOS, and iPadOS.

codepen?

It landed 🛬👀

lovely tip 🙌🐐

Thanks for sharing! I love this technique, it enhances user experience especially for educational content or articles where key points or terminologies are highlighted as the user scrolls through the content.

@dtlantianyou looks great.

Thanks bro

@SaveToNotion #tweet

wow, thanks for sharing

Can you recommend to course/ article if I want to deep dive into CSS things like this? Feels lose to achieve my goals to have the skill to create something like this?

Erm – I am eventually going to start putting things like this onto a site somewhere as mini blog posts. As for courses and articles. I've put together some. But, for me, it's often been the case of learning by doing. Having an idea and then finding the answers to solve it. That over a number of years has got me here.
