nuxt-booster icon indicating copy to clipboard operation
nuxt-booster copied to clipboard

Would like have a better friendly style of LoadingSpinner

Open Quineone opened this issue 3 years ago • 3 comments

Describe the bug Instead of set the loading spinner for img tag

.${this.className}.loading {
  background-image: url(${this.#dataUri});
  background-repeat: no-repeat;
  background-position: center;
  background-size: ${this.#size};
  background-color: ${this.#backgroundColor};
 }

image

would like to set this for the img's pseudo-elements :before or :after

.${this.className}.loading:after {
  background-image: url(${this.#dataUri});
  background-repeat: no-repeat;
  background-position: center;
  background-size: ${this.#size};
  background-color: ${this.#backgroundColor};
  content: '';
  display: block;
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
 }

image

Quineone avatar Jul 08 '22 03:07 Quineone

Hello @Quineone,

currently the LoadingSpinner in the component SpeedkitImage used as background. This is the reason because otherwise the <img /> needs a container to use a pseudo element.

The only alternative I see is to use different LoadingSpinner in SpeedkitPicture and SpeedkitImage and integrate the LoadingSpinner in SpeedkitPicture and disable it in the embedded SpeedkitImage.

In this case theLoadingSpinner must be extended by a selector customization.

ThornWalli avatar Jul 10 '22 13:07 ThornWalli

Hi @ThornWalli , thx, indeed, that's would be better.

Quineone avatar Jul 11 '22 02:07 Quineone