1

I'm trying to use Rails 3.2 with Sass. I tried to create a Sass file in my project to define all global variables based on Railscast #268. But I kept getting Sass::SyntaxError because of undefined variables.

What I have:

application.css.scss

/*
*= require_self
*/

@import "variables.css.scss";
@import "layout.css.scss";

variables.css.scss

$font_size: 14px;

layout.css.scss

body { 
    font-size: $font_size;
}

I don't know what I'm doing wrong here. Any suggestion would be great!

4

1 に答える 1

2

You would want to put the sass files that requieres this variables as partials (for example _layout.css.scss) this will prevent rails to try to compile them individually without their dependencies.

于 2013-02-03T23:50:53.463 に答える