Cal*_*ers 5 ruby ruby-on-rails sass compass-sass
我已经完成了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/compiled/Compass使用位于"config/compass.rb"中的配置文件,该文件告诉它重要目录的位置.我认为它知道查看config/compass.rb,因为它搜索预定义目录列表中的compass.rb配置文件
下面是我用于Rails 3项目的配置文件
# This configuration file works with both the Compass command line tool and within Rails.
# Require any additional compass plugins here.
project_type = :rails
project_path = Compass::AppIntegration::Rails.root
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "public/stylesheets"
sass_dir = "app/stylesheets"
images_dir = "public/images"
environment = Compass::AppIntegration::Rails.env
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
preferred_syntax = :sass
Run Code Online (Sandbox Code Playgroud)
我通过从Rails根目录运行以下命令来生成此文件:
compass init rails --css-dir=public/stylesheets --sass-dir=app/stylesheets --images-dir=public/images -x sass --using blueprint/basic
Run Code Online (Sandbox Code Playgroud)
这是我用来运行指南针的唯一命令,我在通过rails模板https://github.com/sid137/rails-templates/blob/master/rails3.rb生成项目时运行它 .我通过阅读指南针帮助,并在线查看,构建此命令,因为我想自定义我的所有指南针设置.现在,我可以立即开始我的项目
compass watch .
Run Code Online (Sandbox Code Playgroud)
要么
compass compile .
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7901 次 |
| 最近记录: |