postcss-inline

1.2.0 • Public • Published

PostCSS Inline Build Status

PostCSS plugin that puts images and fonts as data URIs into your CSS. (based on PostCSS Image Inline)

@font-face {
  font-family: 'MyWebFont';
  src: url('webfont.woff') format('woff');
}
.foo {
    background-inline: url(one_pixel_transparent.gif);
}
@font-face {
  font-family: 'MyWebFont';
  src: url('data:application/x-font-woff;base64,AACH5BAEAAAAALA...==') format('woff');
}
.foo {
    background-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==);
}

Usage

postcss([ require('postcss-inline') ])
// Inline only woff files:
postcss([ require('postcss-inline'){filter: /.woff$/} ])
// Specify the base path for the assets
postcss([ require('postcss-inline'){basePath: '/some/path'} ])

See PostCSS docs for examples for your environment.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    136
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    136
  • 1.1.0
    2
  • 1.0.0
    2

Package Sidebar

Install

npm i postcss-inline

Weekly Downloads

21

Version

1.2.0

License

MIT

Last publish

Collaborators

  • jantimon