简体   繁体   中英

Sass doesn't load the .scss

I am new to programming and I am trying to make a simple website as an exercise. I use :

  • ruby
  • sinatra
  • sass
  • base(bitters)
  • bourbon
  • neat

The problem I'm facing has something to do with sass, it doesn't load my "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;
}

The error message says: Sass::SyntaxError - File to import not found or unreadable: neat-helpers

All the .scss files from Bourbon, neat and base have an underscore before the actual name.

So neat.scss => _neat.scss

I don't get what's wrong. Could you help me and maybe explain what I did wrong?

You need to use a compiler that's going to convert the file to CSS. Use the compass gem to do that.

Here's a basic implementation you can follow:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM