Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
postcss-image-inliner
Advanced tools
PostCSS plugin to inline local/remote images.
.foo {
/* Input example */
background-image: url("https://placehold.it/10x10");
}
.foo {
/* Output example */
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAo ... ORK5CYII=");
}
var postcss = require('postcss');
var imageInliner = require('postcss-image-inliner');
var opts = {
assetPaths: [], // List of directories where the inliner should look for assets
maxFileSize: 10240 // Sets a max file size (in bytes)
}
postcss([ imageInliner(opts) ])
See PostCSS docs for examples for your environment.
##Options
####assetPaths
Type: array
Default: [process.cwd()]
Example: ['http://domain.de/', 'http://domain.de/styles', 'app/images', '**/images/']
Required: false
List of directories/urls where the inliner should start looking for assets. You can define local directories (globs supported) or URLs.
####maxFileSize
Type: int
Default: 10240
Example: 0
Required: false
Sets a max file size (in bytes) for inlined images. Set to 0
to disable size checking.
####b64Svg
Type: bool
Default: false
Required: false
Use Base64 encoding for svgs.
####strict
Type: bool
Default: false
Required: false
Fail on error
FAQs
PostCSS plugin to inline images into css
The npm package postcss-image-inliner receives a total of 25,572 weekly downloads. As such, postcss-image-inliner popularity was classified as popular.
We found that postcss-image-inliner demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.