GithubHelp home page GithubHelp logo

Comments (8)

bodyno avatar bodyno commented on September 26, 2024

这个还是支持下比较好,不然太不灵活了

from grunt-css-sprite.

xuexb avatar xuexb commented on September 26, 2024

from grunt-css-sprite.

stoneChen avatar stoneChen commented on September 26, 2024

这个问题,是不是可以这么解决:在最初开发页面的时候,就按不同的css分好需要拼在同一张大雪碧图里,然后分开多个子任务自动合并。
比如:
把a1.png, a2.png, a3.png放在images/a目录下
把b1.png, b2.png, b3.png放在images/b目录下
这个步骤其实没必要,只不过在人工看代码的时候,会清晰一些,一看就知道哪个目录下是会拼在同一个雪碧图中的
然后Gruntfile.js:

//省略初始化等代码
//其他任务
sprite:{
   a:{
        //其他配置
        imagepath:'images/a/**/*.png',
        spritedest:'dist/images/a.sprite.png',
        src:'css/a/**.*.css',
        dest:'dist/css/a.sprite.css'
   },
   b:{
        //其他配置
        imagepath:'images/b/**/*.png',
        spritedest:'dist/images/b.sprite.png',
        src:'css/b/**.*.css',
        dest:'dist/css/b.sprite.css'
   }
}
//其他任务,比如将a.sprite.css和b.sprite.css合并+压缩

from grunt-css-sprite.

bodyno avatar bodyno commented on September 26, 2024

@stoneChen 你这种方法只不过是另辟蹊径,没有根本的解决问题!

from grunt-css-sprite.

xuexb avatar xuexb commented on September 26, 2024

我本地已扩展了一个imgName

from grunt-css-sprite.

ar-insect avatar ar-insect commented on September 26, 2024

为何在本地无法产出雪碧图,而css可以产出,配置如下:

sprite: {
autoSprite: {
imagepath: 'images/slice/.png',
spritedest: 'assets/dist/images/button.sprite.png',
src:'static/css/
.css',
dest:'assets/dist/css/button.sprite.css'
}
}

不知道有什么问题,指教。

from grunt-css-sprite.

bodyno avatar bodyno commented on September 26, 2024

没问题,下次再搞吧

from grunt-css-sprite.

cymmint avatar cymmint commented on September 26, 2024

同问,如果改图片输出名字

from grunt-css-sprite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.