laoshu133 / grunt-css-sprite

A grunt plugin to help front engineer creating css sprite.
MIT License
65 stars 29 forks source link

請問如何配置才能正確用到background-size去做高清圖雪碧圖 #15

Closed xiaoyaojones closed 10 years ago

xiaoyaojones commented 10 years ago

假設我slice目錄有a.png & b.png & c.png三張圖片和imgs.css, 然後在imgs.css裏面應該要如何編寫才能使生成的雪碧圖和css帶上的width、height、background-size、background-position都是原定位的一半呢?

等答覆,謝謝!

laoshu133 commented 10 years ago

css 不需要做特殊配置,slice内图片含有 @2x的图片就好,比如:a.png, a@2x.png 具体参考示例: https://github.com/laoshu133/grunt-css-sprite/blob/master/test/css/icon.css 生成后CSS: https://github.com/laoshu133/grunt-css-sprite/blob/master/test/publish/css/icon.sprite.css