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

Does this inline background images specified in css files? #58

Closed
tommedema opened this issue Dec 21, 2017 · 4 comments
Closed

Does this inline background images specified in css files? #58

tommedema opened this issue Dec 21, 2017 · 4 comments

Comments

@tommedema
Copy link

This is a requirement for my use case (ie inline background images in css files as base64)

@popeindustries
Copy link
Owner

Unfortunately this does not. It inlines content into HTML files in a declarative way (with an inline attribute, or similar). I'm not sure how you could declaratively flag background css image inlining, but I'm open for suggestions.

@cecilpeng
Copy link

why not use query string, such as ?inline

@dinony
Copy link

dinony commented Jun 28, 2018

Or if inline attribute is used on stylesheet all urls in css are inlined too, otherwise not.

@dinony
Copy link

dinony commented Jun 28, 2018

Or another solution:

First use postcss-assets inline feature and then inline the css file with this tool.

postcss-assets inline feature works like this:

.test {
  background-image: inline({somePath})
}

will gen

.test {
  background-image: url('data:image/...........')
}

There you go 👍

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

4 participants