News for hackers. Stuff that matters.
Re:Using easing for more than just CSS transitions by tobr on Tuesday January 07, 2020 @11:46AM (#21981655)
> And the way box shadows are implemented on the web is similar to gradients: they use a linear transition.

This is wrong. Yes, linear gradients are everywhere, even in nearly every professional graphic design tool, which is unfortunate since they are almost always the wrong choice. Box shadows, on the other hand, tend to be based on Gaussian blurs, which certainly doesn’t create a linear transition. This is also the way the CSS box-shadows spec say they should work: https://drafts.csswg.org/css-backgrounds-3/#shadow-blur

Re:Using easing for more than just CSS transitions by kilian on Tuesday January 07, 2020 @01:24PM (#21982884)
I stand corrected, I’ll update the article!

If you compare the regular box shadow to the stepped example, it’s very clear that the gaussian blur doesn’t look nearly as natural as the multi stepped one.

Re:Using easing for more than just CSS transitions by csallen on Tuesday January 07, 2020 @02:14PM (#21983511)
> which is unfortunate since they are almost always the wrong choice

Why?

Re:Using easing for more than just CSS transitions by reggieband on Tuesday January 07, 2020 @05:40PM (#21985933)
I searched for a source but I couldn't find one. My recollection on the topic has to do with how humans perceive luminance within a gradient. Our eyes are better/worse at determining contrast differences between adjacent colours at different luminance. If you search for "luminance gradient" on Google you'll find a lot of scholarly articles on the subject but I was unable to track down one directly applied to graphic design. There is also a semi-famous demonstration [1] of how our eyes perceive gradients as shadows.

In general this isn't an issue since most designers will either just stretch the gradient out or add additional gradient control points to adjust to fall-off manually.

1. http://persci.mit.edu/gallery/checkershadow

Re:Using easing for more than just CSS transitions by tobr on Wednesday January 08, 2020 @01:08AM (#21988793)
The article already explains and exemplifies this. It produces abrupt changes in “velocity” of the gradient at every color stop, which is rarely something you want.
Re:Using easing for more than just CSS transitions by pixelbash on Tuesday January 07, 2020 @02:41PM (#21983880)
I'm guessing because linear transitions often look unnatural. E.g. trying to do fades
Re:Using easing for more than just CSS transitions by vortico on Tuesday January 07, 2020 @12:43PM (#21982345)
As soon as I scrolled to the "Easing for box shadows" section where the examples were visible, my browser became laggy and dropped from 60Hz framerate to about 15Hz. Use these with caution, and test on a range of devices your visitors are using.
Re:Using easing for more than just CSS transitions by hadrien01 on Tuesday January 07, 2020 @01:32PM (#21982968)
What browser are you using, and what specs? I had no problem on my mid-range mobile device
Re:Using easing for more than just CSS transitions by brumm on Tuesday January 07, 2020 @01:36PM (#21983027)
Thanks for featuring my little shadow tool! I'm glad it's useful!

There's a figma plugin out now as well: https://www.figma.com/c/plugin/788830704169694737/SmoothShad...

Re:Using easing for more than just CSS transitions by kilian on Tuesday January 07, 2020 @01:38PM (#21983051)
Yes, I love it!
Re:Using easing for more than just CSS transitions by jesuisuncaillou on Tuesday January 07, 2020 @12:09PM (#21981934)
Ha ! Now I know why my linear gradients always felt weird !
Re:Using easing for more than just CSS transitions by mobilemidget on Tuesday January 07, 2020 @03:21PM (#21984354)
That green overlay stuff isn't the most pleasant while trying to read the page I have to admit.
Re:Using easing for more than just CSS transitions by speg on Tuesday January 07, 2020 @01:58PM (#21983315)
> And the difference between these is pretty big:

Am I the only one who can't tell the different between them (Easing for box shadows)?

Re:Using easing for more than just CSS transitions by reroute1 on Tuesday January 07, 2020 @02:14PM (#21983504)
It is a bit subtle, I think the background of the page and the text below isn't doing it a favor.

Quickly in the browser giving the <p> below a margin-top of 150px and then moving it over a white part of the background (or making it white if you like), the effect becomes more obvious and it does look a bit blockier around the edges to me in the linear example. I would prefer the second as I'm seeing it.

Re:Using easing for more than just CSS transitions by drenvuk on Tuesday January 07, 2020 @02:34PM (#21983801)
On Firefox this website lags from the get go. I think you should have all your ducks in a row before offering advice on features related to what you're talking about.
Re:Using easing for more than just CSS transitions by zamadatix on Tuesday January 07, 2020 @08:06PM (#21987192)
Scrolling through it on Firefox I get <1% CPU and <2% GPU without seeing any lag. Curious if you have hardware acceleration working? Or maybe you're hitting a corner case bug?