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

Minify CSS URLs #535

Closed
surrim opened this issue Mar 4, 2016 · 4 comments
Closed

Minify CSS URLs #535

surrim opened this issue Mar 4, 2016 · 4 comments

Comments

@surrim
Copy link

surrim commented Mar 4, 2016

minifyURLs doesn't pay attention to the following snippet:

<style>
    html {
        background-image: url("http://example.com/images/background-1.jpg");
    }
</style>

That's because html-minifier calls clean-css for inline CSS and clean-css doesn't use relateurl.
A possible solution for that would be to replace the url(...)-parts with html-minifier directly.

@alexlamsl
Copy link
Collaborator

clean-css has its own mechanisms for URL rewrites, namely rebase, relativeTo and root.

@alexlamsl
Copy link
Collaborator

In theory we can populate those fields I mentioned within minifyCSS when they are not specified by the user, and minifyURLs.site is defined.

@kangax @XhmikosR how do you feel about this?

@surrim
Copy link
Author

surrim commented Mar 8, 2016

Thanks for the cute patch, works fine here.

@alexlamsl
Copy link
Collaborator

Thanks for testing. 👍

This was referenced Mar 8, 2016
alexlamsl added a commit that referenced this issue Apr 14, 2016
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

No branches or pull requests

2 participants