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

background-image gradients are lost if background-image has a url defined as the "background" #466

Closed
AlexKeySmith opened this issue Feb 26, 2015 · 3 comments
Labels

Comments

@AlexKeySmith
Copy link

Take the following CSS:

.test {
    background: url("http://placehold.it/100x100");
    background-repeat: repeat;
    background-image: linear-gradient(rgba(44, 44, 44, 0.1), rgba(44, 44, 44, 0.5)), url("http://placehold.it/100x100");
    width: 100px;
    height: 100px;
}

This will result in:

.test{background:url(http://placehold.it/100x100);background:url(http://placehold.it/100x100);width:100px;height:100px}

Note, the linear-gradient is lost.

If you remove the url on the background e.g. the following

background-image: linear-gradient(rgba(44, 44, 44, 0.1), rgba(44, 44, 44, 0.5)), url("http://placehold.it/100x100");

becomes:

background-image: linear-gradient(rgba(44, 44, 44, 0.1), rgba(44, 44, 44, 0.5))

It does not occur.

It is probably not the most sensible CSS, however it is interpreted in the browser as expected, whereas clean-css gives you a surprise :-)

@jakubpawlowicz
Copy link
Collaborator

That's surprising indeed!

jakubpawlowicz added a commit that referenced this issue Mar 1, 2015
In case of multi-value shorthands (comma separated) we reuse tokens
instead of cloning when splitting / rebuilding values.

There was an edge case in rebuilding when having more than one
`background` in a rule.
@jakubpawlowicz
Copy link
Collaborator

Fixed in 3.1.2!

@AlexKeySmith
Copy link
Author

Thanks @jakubpawlowicz ! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants