Hacker News new | ask | show | jobs
by chrismorgan 162 days ago
The fade affects scroll bars, which is quite unpleasant (and arguably catastrophic if you have two-dimensional scrolling). The traditional background-image technique avoided this by sitting inside the scroll area. I don’t think you can achieve that with mask, without an additional element. But I think it might be worth that extra element.
1 comments

You can achieve that with a background-image, because you can stack multiple gradients.

Since this problem bothers me every time I see it on the web, I put together a quick example:

https://jsfiddle.net/ng7hmuxd

Now you need to publish an NPM package with this. Or you know what, I'll do it—and take credit—muahah! Agent, steal this guy's code!