SOLVED: Button transitions applied to background (a) and text (span) separately when using "CSS Transition" setting

I’ve been experimenting with CSS transitions on my button styles in a new bricks site I’m building.

20220107-xr0y0

I noticed what I considered to be a jarring/displeasing transition but couldn’t quite place my finger on it. It just seemed to “flash” instead of smoothly change.

I slowed the transition way down and discovered that transition rules are applied separately to the button container AND the span within it which - at least in chrome - causes the background color and text color transitions to be rendered in succession instead of simultaneously.

Here’s a pen showing the behavior:

https://codepen.io/mrcave/pen/jOGpLqR

If you hover over the “slow” version in my example you can clearly see how the background transition is fully completed before any transition of the text begins.

I assume this affects other modules as well but I haven’t investigated deeply. And maybe there’s a good reason for it that I’m not understanding (i.e. not a bug). But in its current state that particular setting is useless to me and we have to instead code up our own separate custom CSS on the impacted modules.

1 Like

Hi Denny,

thanks so much for your report and the extensive description / examples!
I was able to reproduce the issue. It happens because the transition is applied to both #bricks-element-ltiasj .bricks-button and #bricks-element-ltiasj *.

We’ll fix this soon :slight_smile:

Best regards,
timmse