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

Fixed a bug in the background image-set function #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

max-kot
Copy link

@max-kot max-kot commented Aug 26, 2024

Hi! When I used your plugin with gulp, I found some issue width image-set function with background property.

My bug was about additional adding of background-repeat, background-position and background-size and poproperties for additional url.

Input:

.test {
	background-color: var(--color-dark);
	background-image: image-set(
		url("../images/cover.png") type("image/png") 1x,
		url("../images/[email protected]") type("image/png") 2x,
		url("../images/[email protected]") type("image/png") 3x
		);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

Output:

.test {
	background: image-set( url("../images/cover.png") type("image/png") 1x, url("../images/[email protected]") type("image/png") 2x no-repeat center/cover, url("../images/[email protected]") type("image/png") 3x ) no-repeat center/cover var(--color-dark);
}

So, I actually found out how to fix it, and with that fix the final output looks like this:

.test {
	background: image-set( url("../images/cover.png") type("image/png") 1x, url("../images/[email protected]") type("image/png") 2x, url("../images/[email protected]") type("image/png") 3x ) no-repeat center/cover var(--color-dark);
}

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.

1 participant