我对在Windows上使用Compass应用程序感兴趣。我购买了该产品,但它绝对没有任何文档。 (失败)
我不知道如何使用它。
我创建了一个项目并得到了这个结构
directory compassProject/
directory stylesheets/
directory project/
create manifest.rb
create _main.scss
create screen.scss
我假设我要在某个地方编辑
css
文件,指南针将使用SASS
在其他地方重写它?提前致谢
Teedub
最佳答案
对于Windows,您需要安装Ruby(必需)。从现在开始,建议您使用Ruby 1.9.3安装程序:RubyInstallers:Ruby 1.9.3-p550
一旦安装了Ruby,请安装Compass:gem install compass
有关安装Ruby for Windows的更多信息,请参阅我在该主题上发表的这篇文章:
http://jimfrenette.com/2014/11/compass-on-windows/
萨斯
设置sass以自动编译style.scss
在项目的sass文件夹中,执行sass watch命令。只要保存了style.scss文件,就会使用所有适用的浏览器扩展,可重用属性等来编写相应的style.css。
# change to your sass folder in your project directory
# e.g., cd ~/mywebsite/sass
$ sass --watch style.scss:../css/style.css
>>> Sass is watching for changes. Press Ctrl-C to stop.
←[32m write ../css/style.css
←[0m←[32m write ../css/style.css.map
←[0m
这篇文章详细介绍了使用Bourbon(一种类似的较轻的Compass替代品),如果您感兴趣,这可能会有所帮助: