3 ms·
The blur filter is notoriously slow on performance. I find it interesting that the author didn't explore the "spread" parameter of box-shadow at all, I wonder i
by err4nt 6y ago
The blur filter is notoriously slow on performance. I find it interesting that the author didn't explore the "spread" parameter of box-shadow at all, I wonder if they realize it exists https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow
- numlock86 6y ago> The blur filter is notoriously slow on performance. I am curious: Do you have some numbers? What is this statement based on? Intuitively I'd agree, but on a technical level I am not so sure.
- littlestymaar 6y agoI don't have numbers, but browsers must implement it as a Gaussian blur (because that's what the spec says) which is quite costly.
- mattkrick 6y agoWe used to blur content behind modals. When the modal animated in, it'd hit single digits fps on a MacBook pro. Ditched it for a more opaque scrim and fps was back at 60.
- runxel 6y agoShould be the opposite, actually, since the :filter are backed by hardware graphic acceleration.
- tobr 6y agoNo, it should not be the opposite. Any optimization or performant implementation you can think of that works for Gaussian blur, also works for box-shadow. It is a Gaussian blur, but with the added restriction that you know you’re always blurring a single-colored rect or rounded rect.