【问题标题】:Sass doesn't load the .scssSass 不加载 .scss
【发布时间】:2015-01-28 15:56:11
【问题描述】:

我是编程新手,我正在尝试制作一个简单的网站作为练习。我用:

  • 红宝石
  • 辛纳特拉
  • 萨斯
  • 碱(苦味)
  • 波旁威士忌
  • 整洁

我面临的问题与 sass 有关,它没有加载我的“style.scss”:

application.rb:

require "sinatra"

get "/" do
   erb :Home
end

get "/style.css" do 
   scss :"scss/style"
end

layout.erb:

<html>
    <head>
        <link rel="stylesheet"  href="/style.css" >
        <title>Home</title>
    </head>
    <body>




    <div class="article">

        <%= yield %>
    </div>
    </body>
</html>

Home.erb:

<p> text </p>

style.scss:

@import "normalize";
@import "bourbon/bourbon";
@import "base/base";
@import "neat/neat";

$column: 90px;
$gutter: 30px;
$grid-columns: 10;
$max-width: em(720);

body {
    background-color: #b8b8b8;
}

a {
    color: #CC1212;
}

div.article {
    @include outer-container;
    background-color: #cfcfcf;
}

错误消息说:Sass::SyntaxError - 找不到要导入的文件或不可读:整洁的助手

所有来自 Bourbon、整洁和基础的 .scss 文件在实际名称前都有一个下划线。

如此整洁的.scss => _neat.scss

我不明白有什么问题。你能帮我解释一下我做错了什么吗?

【问题讨论】:

    标签: css ruby-on-rails ruby sass sinatra


    【解决方案1】:

    您需要使用将文件转换为 CSS 的编译器。使用指南针 gem 来做到这一点。

    这是您可以遵循的基本实现:

    https://github.com/Compass/compass/wiki/Sinatra-Integration

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-09
      • 1970-01-01
      • 2020-04-05
      • 2014-10-22
      • 2015-12-18
      • 2017-10-02
      • 2017-10-16
      相关资源
      最近更新 更多