【问题标题】:Using compass - css styling not applying foundation.css使用指南针 - css 样式不应用foundation.css
【发布时间】:2014-10-22 10:50:08
【问题描述】:

几天前用 Sass 安装了 Foundation 5。但是,之后:

  • 基础新 test_grid
  • cd test_grid
  • 指南针手表

watch 创建的文件、目录...

打开 index.html 并且没有样式。 (我也试过'compass compile'和'compass watch',但没有任何变化。

指南针使用的config.rb显示:

add_import_path "bower_components/foundation/scss"

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "js"

app.scss 显示:

@import "settings";
@import "foundation";

查看 stylesheets/app.css 似乎没有导入foundation.css 文件。

对正在发生的事情有任何想法吗?可能是一个完全新手的问题...把我的头撞到墙上并在谷歌上搜索到令人作呕的结果。


根据建议,我重新安装了 compass,但还是一样。 看的时候指南针好像没问题:

emily@emily:~/sites/test_grids(master*)$ compass watch
>>> Compass is watching for changes. Press Ctrl-C to Stop.
directory stylesheets
write stylesheets/app.css

当我修改 bower_components/foundation/scss/foundation.scss (insert p {font-size: 10rem;} 它显示:

modified bower_components/foundation/scss/foundation.scss
write stylesheets/app.css

刷新后的 index.html 字体大小发生变化,但同样没有foundation.css 样式。

【问题讨论】:

    标签: css sass zurb-foundation


    【解决方案1】:

    我也遇到了这个问题,在这里找到了答案:

    https://stackoverflow.com/a/25560150/3990944

    最新的 Sass 和 Compass 不兼容。尝试卸载和安装旧版本。为我工作。详细信息在上面的帖子中。

    【讨论】:

    • 谢谢!几乎准备放弃它,但这有效!将向基金会发送通知,让他们知道该问题。
    【解决方案2】:

    您希望更改 _settings.scss 或 app.scss,而不是位于 Bower 组件中的文件。在此处查看文件说明:

    http://foundation.zurb.com/docs/sass-files.html

    如何使用 http://foundation.zurb.com/docs/using-sass.html

    【讨论】:

    • 您对用于自定义的文件是正确的,但我的主要问题是默认的foundation.css 样式不适用于index.html。 -- 当我查看 stylesheets/app.css 文件时,foundation.css 中的类样式没有列出。 -- 查看样式的唯一方法是在 index.html 中添加一个 指向 Foundation.css 文件。
    【解决方案3】:

    试试这个:

    sudo gem uninstall compass 1.0.0
    
    sudo gem uninstall sass 3.4.0
    
    sudo gem install sass --version 3.2.9
    
    sudo gem install compass --version 0.12.7
    

    这个方法对我有用

    【讨论】:

      猜你喜欢
      • 2011-08-22
      • 2013-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-27
      • 2018-12-30
      • 2013-02-24
      • 1970-01-01
      相关资源
      最近更新 更多