We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When using the blur up plugin, the inline style set for the images are lost during the plugin execution.
Steps to reproduce the behavior:
aspect-ration: 1 / 1;
blur-up
lazyload
What is the expected behavior: The CSS properties should be preserved.
What happened instead: The CSS properties are getting lost.
Root cause At https://github.com/aFarkas/lazysizes/blob/gh-pages/plugins/blur-up/ls.blur-up.js#L111C4-L111C11
The following line
blurImg.cssText = img.cssText;
should be instead:
blurImg.style.cssText = img.style.cssText;
cssText is a property of style attribute of the element, not the element itself. See: https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/cssText
cssText
style
Workaround As a workaround, it is possible to set up the cssText attribute for the HTMLImageElement to proxy the element.style.cssText attribute:
element.style.cssText
Object.defineProperty(window.HTMLImageElement.prototype, 'cssText', { get() { return this.style.cssText; }, set(newCssText) { this.style.cssText = newCssText; }, });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
When using the blur up plugin, the inline style set for the images are lost during the plugin execution.
Steps to reproduce the behavior:
aspect-ration: 1 / 1;
)blur-up
andlazyload
classes to the elementWhat is the expected behavior:
The CSS properties should be preserved.
What happened instead:
The CSS properties are getting lost.
Root cause
At https://github.com/aFarkas/lazysizes/blob/gh-pages/plugins/blur-up/ls.blur-up.js#L111C4-L111C11
The following line
should be instead:
cssText
is a property ofstyle
attribute of the element, not the element itself.See: https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/cssText
Workaround
As a workaround, it is possible to set up the
cssText
attribute for the HTMLImageElement to proxy theelement.style.cssText
attribute:The text was updated successfully, but these errors were encountered: