grunt less smartsprites
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
node_modules
tasks
test
.jshintrc
.npmignore
.travis.yml
AUTHORS
CHANGELOG
CONTRIBUTING.md
Gruntfile.js
LICENSE-MIT
README.md
package.json

README.md

grunt-contrib-smartsprites

本程序完全 Copy https://github.com/gruntjs/grunt-contrib-less

唯一区别就是原程序在编译 Less 时,会破坏 https://github.com/carrotsearch/smartsprites 特定注释语法 background-image:url('@{bg-srpite-url}bg-step.png'); /** sprite-ref: bg-step;*/,导致 smartsprites 无法正确解析运行,so......

使用方法:

完全同 https://github.com/gruntjs/grunt-contrib-less 唯一区别就是增加了一个 smartSpriteTag 参数

npm install grunt-contrib-smartsprites --save-dev

grunt.loadNpmTasks('grunt-contrib-smartsprites');

//grunt smartsprite
smartsprite: 
{
    options: 
    {
        smartSpriteTag : true,
        ......
    }
}

smartSpriteTag

Type: Boolean
如果为 True 会在 Less 编译时,保存 smartsprites 特定注释语法,否则不做任何处理

感谢:

  • Waitcat

最后