gulp-css-url-prefix

1.0.2 • Public • Published

gulp-css-url-prefix

Prefix urls with a matching pattern in CSS stylesheets

Install

npm install gulp-css-url-prefix

Usage

urlPrefix(prefix, regexMatch)

prefix being what you want prefixed to the url

regexMatch being which url you want to target.

For example you may have background-image: url('/assets/images/bg.png');' and you only want to target the urls beginning with /assets/ and so you would do urlPrefix('http://example.com', '\/assets')

var urlPrefix = require('gulp-css-url-prefix');
 
gulp.task('css-assets', function() {
  return gulp.src('src.css')
    .pipe(urlPrefix('http://example.com', '\/assets'))
    .pipe(gulp.dest('style.css'));
});

Readme

Keywords

none

Package Sidebar

Install

npm i gulp-css-url-prefix

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • gilbert09