Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-image-inliner

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-image-inliner

PostCSS plugin to inline images into css

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28K
increased by6.21%
Maintainers
1
Weekly downloads
 
Created
Source

PostCSS Image Inliner Build Status

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=");
}

Usage

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'] Required: false

List of directories where the inliner should start looking for assets. You can define local directories 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.

Keywords

FAQs

Package last updated on 19 Sep 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc