Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Laura Cressman
Laura Cressman
12,548 Points

Getting CSS files to update automatically using Sass

Hi everyone, I posted this earlier, but still don't have an answer, so I thought I'd try again. I'm trying to use the sass --watch . command in the Terminal as was shown in the video, but I get write ./test.css at the end instead of overwrite .test/css at the end. I even tried installing rb-fsevent and that didn't work either. Any other suggestions? Here's what the command line shows: lauracrsmansmbp:~ lauracressman$ sudo gem install rb-fsevent Successfully installed rb-fsevent-0.9.4 Parsing documentation for rb-fsevent-0.9.4 1 gem installed lauracrsmansmbp:~ lauracressman$ cd Documents lauracrsmansmbp:Documents lauracressman$ sass test.scss p { color: blue; width: 40px; height: 10px; font-size: 1.2em; } lauracrsmansmbp:Documents lauracressman$ sass --watch . >>> Sass is watching for changes. Press Ctrl-C to stop. [Listen warning]: Listen will be polling for changes. Learn more at https://github.com/guard/listen#polling-fallback. >>> Change detected to: test.scss write ./test.css

I don't get overwrite, which I think is the issue.

Thanks, Laura

6 Answers

Mine also states "write" not "overwrite". Are you saying that it is not adding changes to the css file. Here is a screenshot of mine updating here

Laura Cressman
Laura Cressman
12,548 Points

Yes, I get what yours says, but when I open the test.css file, I just see a blank file. No changes were added for me :(

What directory is your .scss file and also are you running sass --watch . in the same directory??

Laura Cressman
Laura Cressman
12,548 Points

I put them both in Documents, and I use the cd Documents command in the Terminal. Should I create a new directory, and do cd Documents/Sass for example?

It should be working, is there a test.css file inside the documents directory? If so delete then run the sass --watch . command again then check back to see if the test.css file have been created.

Laura Cressman
Laura Cressman
12,548 Points

Yes, it created test.css for me, but it won't make any of the changes.

Can you post the contents of your test.scss file in here. You can see the Markdown Cheatsheet below for tips on posting code. Also try to limit your responses to comments not answers by clicking Add Comment

Laura Cressman
Laura Cressman
12,548 Points

I think it's working now, was having a blank test.css file there just messing it up? I appreciate the help Adam!

Anytime :)

Joseph Bramall
Joseph Bramall
12,211 Points

Hi guys, i've followed this. My test file is in a directory called scss and i'm in that directory in terminal. The .css file has been created but it won't update and i'm saving and clicking on the screens as in the video. I get this in the terminal:

Josephs-MacBook-Pro:sass josephbramall$ sass --watch .

Sass is watching for changes. Press Ctrl-C to stop. write ./test.css [Listen warning]: Listen will be polling for changes. Learn more at https://github.com/guard/listen#polling-fallback.

Any suggestions? I've deleted the css file and have run --watch . again but the same thing happened.

Gregory Dunn
Gregory Dunn
10,254 Points

Having same problem as above.