目前我正在使用sass
sass --watch path1:path2
Run Code Online (Sandbox Code Playgroud)
将scss文件编译为css但我甚至找到了
compass watch path1:path2
Run Code Online (Sandbox Code Playgroud)
也.这两款手表有什么区别吗?我创建了一个项目,compass create project
发现有两个主要文件夹调用sass
,stylesheets
我查找screen.scss
文件,我找到了代码@import "compass/reset";
,但没有任何目录调用compass
来调用重置.
我真的很喜欢sass和指南针.任何人都可以解释我如何使用罗盘?任何帮助将不胜感激.提前致谢.
使用指南针当我试图创建一个精灵时,screen.css中主精灵图像的路径出错了,因为我无法看到图像.
我的scss代码是
@import "compass";
@import "spr/*.png";
h1 { @include spr-sprite("car"); height:50px; width:50px; }
Run Code Online (Sandbox Code Playgroud)
我的css输出为精灵
.spr-sprite, h1 { background: url('/images/spr-sa37328aec0.png') no-repeat; }
h1 { background-position: 0 -147px;
height: 50px;
width: 50px;
overflow: hidden;
text-align: left;
}
Run Code Online (Sandbox Code Playgroud)
你可以看到背景不应该开始,../
而不是直接开始/images/
.它造成了一个问题.我的图像文件夹路径
images
------spr
---*.png
sass
-----screen.scss
css
---screen.css
Run Code Online (Sandbox Code Playgroud)
我的config.rb代码
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = …
Run Code Online (Sandbox Code Playgroud)