0

I followed Michael Hartl's tutorial (http://www.railstutorial.org/), and I want to change some css functions within the custom.scss.css stylesheet. Whenever I make any changes to the sheet, for example, changing the margin from 10 px to 11 px, I get this error in my browser:

Sass::SyntaxError in StaticPages#home
Showing /Users/Desktop/Sample_App/app/views/layouts/application.html.erb where line #5 raised:

Undefined variable: "$gray-light".
  (in /Users/Desktop/Sample_App/app/assets/stylesheets/custom.css.scss:57)
Extracted source (around line #5): 

Here is a similar problem: Bootstrap not working after minor change to custom.css.scss

I don't understand why this is happening.

1 Answer 1

1

You're trying to use a sass variable that is not defined. Define "$gray-light" or make sure the file that it lives in is @imported.

Sign up to request clarification or add additional context in comments.

2 Comments

I did try defining $gray-light, and it gave me the same error. The file does have @import "bootstrap" at the top. The problem is any changes can cause a crash. The file itself would run without error, but the slightest change can cause an error.
If it's true that ANY change causes an error, it may be that your system is not properly set up for sass to compile scss files. It technically only compiles them once a change has been made so you may not see it until you try to change something. Have you tried clearing out the file completely to see if an error is produce? If so, the error is not in the file itself, but somewhere upstream.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.