【问题标题】:Include all scss files in a folder将所有 scss 文件包含在一个文件夹中
【发布时间】:2013-03-29 19:10:31
【问题描述】:

我正在使用 Sencha Touch 开发一个项目(不确定这是否是一个重要的事实),我想将使用 compass 生成的 CSS 文件包含在一个文件夹中。

所以给定这个项目结构:

index.html
resources
    css
        app.css (generated file)
    sass
        app.scss
        config.rb (sass config file)
ux
    ExamplePlugin1
        style.scss
    ExamplePlugin2
        style.scss

我想要的是将所有 scss 文件包含到“ux”文件夹中到最终的 app.css 文件中。

为了生成 app.css,compass 读取 sass 文件夹中的 config.rb 文件。我修改了该文件以实现此目的,但这没有用。这是config.rb文件的内容:

# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)

# Load the sencha-touch framework automatically.
load File.join(dir, '..', '..', 'resources', 'themes')

# MODIFIED LINE TO INCLUDE THE UX FOLDER
load File.join(dir, '..', '..', 'ux')

# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css")

# Require any additional compass plugins here.
images_dir = File.join(dir, "..", "images")
output_style = :compressed
environment = :production

另一种可能的解决方案是将所有单个文件包含到 app.scss 中,但这也不起作用。我在 app.scss 中添加了这一行:

@import 'ux/ExamplePlugin1';

但是当 compass 尝试编译它时,这给了我和错误:(

我希望这个解释足以解决问题。如果有人需要更多信息,请问! :P

谢谢!

【问题讨论】:

  • 它给出了什么错误?

标签: sencha-touch sass compass-sass


【解决方案1】:

您的问题已经有了解决方案,无需重新发明轮子:

Compass and sass: possible to auto-import all partials?

【讨论】:

    猜你喜欢
    • 2020-03-11
    • 2013-11-22
    • 2016-12-07
    • 1970-01-01
    • 1970-01-01
    • 2020-11-15
    • 1970-01-01
    • 2012-06-13
    • 1970-01-01
    相关资源
    最近更新 更多