0.1.0-beta.2 • Published 5 years ago

postcss-plugin-image-to-url v0.1.0-beta.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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

propvaluedefaultrequire
disabletrue / falsefalsefalse
localBaseDirlocal image pathtrue
remoteBaseLinkremote link basetrue

See PostCSS docs for examples for your environment.