postcss-import-url icon indicating copy to clipboard operation
postcss-import-url copied to clipboard

Inline remote files

Open stefnotch opened this issue 2 years ago • 3 comments

I've been searching for a PostCSS plugin that can optionally inline remote files, such as woff and woff2 fonts, images and svgs.

This one already inlines styles. Would it be possible to extend it to handle other file types?

stefnotch avatar Jan 29 '23 10:01 stefnotch

(The other plugin https://github.com/postcss/postcss-url/issues/133 doesn't seem to work, hence the question here)

stefnotch avatar Jan 29 '23 10:01 stefnotch

This plugin focus to handle @import url ... expession

What plugin did you check? Its seems there is a plenty to choose from search results: https://github.com/search?q=postcss+inline https://github.com/search?q=postcss+base64

unlight avatar Feb 04 '23 21:02 unlight

I just went through every single plugin. Nearly all of them just inline local files, as in, they'll do fs.read...()

There are only three of them that read remote images: https://github.com/lagden/postcss-inline-base64 unusable due to requiring specially formatted strings https://github.com/moshen/postcss-remote-font-inliner for fonts https://github.com/bezoerb/postcss-image-inliner for images

I'll try out those two plugins and hope that they work well enough, I suppose.

stefnotch avatar Feb 04 '23 23:02 stefnotch