1.安装compass。(需要先安装ruby)

命令行:gem install compass

 

 

2.新建一个compass 项目

命令行:compass create myproject

 

 

3.在myproject中新建一个images文件夹,将需要转换的图片放入images新建的share文件中

并在scss文件中写入:

@import "compass/utilities/sprites";     

@import "share/*.png";
@include all-share-sprites;

命令行:compass compile

完成,images文件夹下会显示雪碧图

 

注意:ruby对编码的苛刻,路径,命名不能有中文以及非法字符

 

相关文章:

  • 2021-07-31
  • 2022-02-26
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2021-07-30
  • 2022-02-06
猜你喜欢
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2021-10-05
相关资源
相似解决方案