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

Autocorrect missing "url()" function on data-bg attribute for single backgrounds #347

Closed
wants to merge 3 commits into from

Conversation

juanmardefago
Copy link
Contributor

Closes #346

More info on that issue

Copy link
Owner

@verlok verlok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, but you need to consider that users could want to mix images and gradients.

@@ -72,7 +72,11 @@ export const setSourcesBgImage = (element, settings) => {
}

if (bgDataValue) {
element.style.backgroundImage = bgDataValue;
element.style.backgroundImage = bgDataValue[0] === "u" ?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't work if the first applied background is a gradient. E.g. if bgDataValue is linear-gradient(direction, color-stop1, color-stop2, ...), lazyImage.jpg.

@verlok verlok closed this Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autodetect/Autocorrect missing "url()" function on data-bg attribute
2 participants