Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would like have a better friendly style of LoadingSpinner #651

Open
Quineone opened this issue Jul 8, 2022 · 2 comments
Open

Would like have a better friendly style of LoadingSpinner #651

Quineone opened this issue Jul 8, 2022 · 2 comments
Labels
nuxt 3 Nuxt 3 Support

Comments

@Quineone
Copy link

Quineone commented Jul 8, 2022

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 Quineone changed the title would like have a better friendly style of LoadingSpinner Would like have a better friendly style of LoadingSpinner Jul 8, 2022
@ThornWalli
Copy link
Contributor

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.

@Quineone
Copy link
Author

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

@StephanGerbeth StephanGerbeth added the nuxt 3 Nuxt 3 Support label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nuxt 3 Nuxt 3 Support
Projects
None yet
Development

No branches or pull requests

3 participants