aslansky / css-sprite

css sprite generator
MIT License
733 stars 55 forks source link

Invalid output sprite less #1

Closed aslansky closed 10 years ago

aslansky commented 10 years ago

Issue from @zajca. Description see: aslansky/gulp-sprite#3

zajca commented 10 years ago

same output with css-sprite gulp task (coffee)

gulp.task 'LESS', ['SPRITES'], ->
  gulp.src(config.less.src)
  .pipe(less())
  .pipe(
    autoprefixer(
      "last 2 version",
      "safari 5",
      "ie 8",
      "ie 9",
      "opera 12.1",
      "ios 6",
      "android 4"
    )
  )
  .pipe(gulpif(prod,minifycss()))
  .pipe(gulpif(prod,
    rename(
      suffix: ".min"
    )
  ))
  .pipe(gulpif(prod, rev()))
  .pipe(gulp.dest(config.less.dest))

gulp.task 'SPRITES', ->
  gulp.src(config.img.png.src)
  .pipe(sprite(
    name: 'sprite.png',
    style: 'sprites.less',
    cssPath: '../images/',
    processor: 'less'
  ))
  .pipe(gulpif('*.png', gulp.dest(config.img.png.dest)))
  .pipe(gulpif('*.less', gulp.dest(config.less.sprites)))

sprites.less

  @icons/RSS-x: 5px;
  @icons/RSS-y: 5px;
  @icons/RSS-offset-x: -5px;
  @icons/RSS-offset-y: -5px;
  @icons/RSS-width: 27px;
  @icons/RSS-height: 27px;
  @icons/RSS-total-width: 37px;
  @icons/RSS-total-height: 223px;

also when I do npm install css-sprite --save-dev there is no index.js in node module so it won`t load.

aslansky commented 10 years ago

Missing index.js is solved in 0.6.1. I forgot to remove the files array from package.json.

aslansky commented 10 years ago

In 0.6.2 it should be now something like @icons-RSS-...