Drimage loading animation can break underlying styling

Created on 7 March 2023, over 1 year ago
Updated 6 May 2024, 6 months ago

Problem/Motivation

When (for example) positioning your image absolute the positioning can break when the image is loading using drimage.
This is because drimage uses a wrapper with a keyframe animation attached that is using the css filter & transform property.
This means we will loose the blur & growing animation in favour of a more stable baseline.

Proposed resolution

We can overwrite the animation used, using only properties that won't affect underlying positioning

In the drimage module 'drimage_loader.css'

.drimage.is-loading {
  opacity: 0;
  animation: color-change .45s ease-in-out forwards;
}

@keyframes color-change {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

Add the same in our basetheme, but then only apply the opacity change.

.drimage.is-loading {
  animation: opacity-change .45s ease-in-out forwards;
}

@keyframes opacity-change {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
πŸ› Bug report
Status

Closed: won't fix

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine nginex

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024