“指南针手表”如何运作?工作/如何与 Rails 一起使用
我在项目目录中完成了 compass create .
和 compass init Rails
。有几个问题:
- 我已将
.sass
文件放置在public/stylesheets
中。这是放置它们的正确位置吗? - 当我运行
compass watch
时,它不会自动编译这些.sass
文件。我必须手动指定文件:compass watch public/stylesheets/myfile.sass
等。如何让它自动工作? - 文件
ie.css
、print.css
和screen.css
已放置在stylesheets/compiled
中。如何删除它们而不让它们在编译后重新出现? - 我自己编译的
.sass
文件被编译为compiled/ts
。为什么它们在ts
中而不是在compiled
中?
提前非常感谢
编辑:解决了:
- 不,将它们放入
app/stylesheets/
- 如果您按照上面的操作,则
- 可以将它们从
app/stylesheets/
中删除code> - 做第一个回答,它们将被放入
compiled/
I have done compass create .
and compass init rails
whilst in my project directory. A few questions:
- I have placed my
.sass
files inpublic/stylesheets
. Is this the right place to put them? - When I run
compass watch
, it does not automatically compile these.sass
files. I have to manually specify the files:compass watch public/stylesheets/myfile.sass
etc. How do I get this working automatically? - The files
ie.css
,print.css
andscreen.css
have been placed instylesheets/compiled
. How do I remove these without them reappeareing after compilation? - My own compiled
.sass
files are compiled tocompiled/ts
. Why are they ints
and not incompiled
?
Many thanks in advance
Edit: Worked it out:
- No, put them in
app/stylesheets/
- Works if you follow above
- Remove them from
app/stylesheets/
- Do first answer and they will be put in
compiled/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Compass 使用位于“config/compass.rb”中的配置文件,该文件告诉它重要的目录在哪里。我认为它知道查看 config/compass.rb 因为它在预定义目录列表中搜索 compass.rb 配置文件
这是我用于 Rails 3 项目的配置文件
我通过从 Rails 运行以下命令来生成此文件root:
这是我用来运行 Compass 的唯一命令,我在通过 Rails 模板生成项目时运行它 https://github.com/sid137/rails-templates/blob/master/rails3.rb 。我通过阅读指南针帮助并在线查看来构建此命令,因为我想自定义所有指南针设置。现在,我可以立即开始我的项目
或
Compass uses a configuration file located in "config/compass.rb" which tells it where the important directories are. I think it knows to look in config/compass.rb because it searches a list of predefined directories for a compass.rb config file
Heres the config file I use for my Rails 3 projects
I generate this file by running the following command from the Rails root:
This is the only command that I use to run compass, and I run it when generating my project through a rails template https://github.com/sid137/rails-templates/blob/master/rails3.rb . I constructed this command by reading through the compass help, and looking online, as I wanted to customize all of my compass setup. Now, I can immediately begin my projects with
or