【发布时间】:2012-09-12 08:35:44
【问题描述】:
我有一个使用原版SASS 的现有项目,我想在其中添加Compass。我过去使用过 Compass,但只将它与 compass create 命令一起使用。
我正在寻找一种能够通过仅导入与其关联的 SCSS 文件来利用罗盘功能的方法,而不必遵守它提供的结构。
我该怎么做?
【问题讨论】:
标签: css sass compass-sass
我有一个使用原版SASS 的现有项目,我想在其中添加Compass。我过去使用过 Compass,但只将它与 compass create 命令一起使用。
我正在寻找一种能够通过仅导入与其关联的 SCSS 文件来利用罗盘功能的方法,而不必遵守它提供的结构。
我该怎么做?
【问题讨论】:
标签: css sass compass-sass
在独立项目中,您需要的只是 gem 和 config.rb。我将配置文件从一个项目复制/粘贴到另一个项目,然后调整插件要求和文件结构等设置。你可以使用任何你喜欢的结构,只要你在配置文件中设置它。
这是我当前项目之一的示例:
# Compass CSS framework config file
require 'susy'
require 'modular-scale'
require 'sassy-buttons'
require 'breakpoint'
require 'compass-css-arrow'
require 'rgbapng'
# Require any additional compass plugins here.
project_type = :stand_alone
# Set this to the root of your project when deployed:
http_path = "/"
sass_dir = "sass"
css_dir = "static/css"
images_dir = "static/images"
fonts_dir = "static/fonts"
javascripts_dir = "static/js"
line_comments = false
preferred_syntax = :scss
output_style = :expanded
relative_assets = true
【讨论】:
根据Compass Documentation可以使用
compass init rails path/to/project [--using blueprint]
【讨论】: