postcss-plugin-image-to-url

0.1.0-beta.2 • Public • Published

PostCSS Plugin Image To Url Build Status

PostCSS plugin image-to-url.

.foo {
    /* Input example */
  background-image: url(http://a.com/images/logo.gif);
  color: #f00;
  background: url("./assets/images/logo.jpg") no-repeat;
}
.foo {
  /* Output example */
  background-image: url(http://a.com/images/logo.gif);
  color: #f00;
  background: url("http://a.b.c/images/logo.jpg") no-repeat;
}

Usage

postcss([ require('postcss-plugin-image-to-url')({
  disable: false, // disabled
  localBaseDir: '/images/',
  remoteBaseLink: 'http://a.b.c/images/'
}) ])

Options

prop value default require
disable true / false false false
localBaseDir local image path true
remoteBaseLink remote link base true

See PostCSS docs for examples for your environment.

Package Sidebar

Install

npm i postcss-plugin-image-to-url

Weekly Downloads

2

Version

0.1.0-beta.2

License

MIT

Unpacked Size

4.17 kB

Total Files

7

Last publish

Collaborators

  • dengchao2056