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 Sass Basics (retired) Getting Started with Sass Installing and Using Sass

Herb Bresnan
Herb Bresnan
10,658 Points

Sass is creating a test.css.map file in Notepad instead of Notepad++.

I am just getting started with Sass so I hope this is a clear enough explanation to my situation. I have looked through the forum and did not find anything about a .map extension.

I am using Windows 7 with Notepad++ editor, which is set as my default editor along with Sass-3.4.5

I created 2 files, "test.scss" and "test.css" in Notepad++ and saved them both to Desktop. I have Sass installed properly and responds with the "sass test.scss" command.

When I run "sass --watch ."
I receive this message:

Sass is watching for changes. Press ctrl-c to stop. write ./test.css write ./test.css.map

A third file is created in plain Notepad with the .map extension. Nothing updates in the "test.css" file in Notepad++.

I also tried "Sass watch -test.scss:test.css" and had the same result.

Why is the "test.css.map" being created Notepad instead of Notepad++? And should it even be a .map extension? Could someone explain what I am doing wrong? I have little hair left to pull out.

Thank you.

3 Answers

The .map file that is being generated is called a "sourcemap." It basically allows you to debug Sass in your dev tools like you would vanilla CSS. It's a really nifty feature that you should take advantage of. If you don't want it, you pass the --sourcemap=none flag to the command-line compiler (sass --watch . --sourcemap=none, for instance).

As far as it opening in Notepad, that has something to do with your default programs. You're allowed to set different default programs for each file type. So, I could have my HTML files open in Brackets (a text editor), but my Sass files open in Atom (another text editor), and my JS files open in TextMate (yet another editor). Apparently, .map files open in Notepad by default.

I wouldn't worry about them opening in Notepad too much, as Sass takes care of them for you and you shouldn't have to mess around with them. If you really want them to open with Notepad++, open your Control Panel and look around for the default programs settings. Then set .map files (Windows might call them MAP files) to open in Notepad++. (Sorry I can't give you more specific instructions; I'm a Mac guy.)

Hey Ryan Duchene ,

I'm having an issue with my scss file updating. I was able to get rid of the mapsource but it seems that I can only write. If I update my scss file the css file doesn't update. and the terminal doesn't show any warning about updating my file. Any ideas??

Run gem update sass and try again. There was a bug with --watch in a recent version of Sass that caused it to occasionally not update files, and updating it should solve the problem. If it doesn't, I'll continue trying to debug it with you.

Herb Bresnan
Herb Bresnan
10,658 Points

Ryan Thanks for your reply. I have Notepad++ as default for the extension. I found that each time I enter code I have to reload Notepad. This leads to other questions. In your opinion, just how good is Sass? Why use it for compiling a language I already know? It seems a little redundant. Granted, I know little about Sass, and it is a huge pain in the ass to set up on Windows. Is it going to be worth the trouble in the long term?

My apologies for not responding sooner.

In my honest opinion, Sass is the best thing that has ever happened to CSS. I hear that variables are in the spec for vanilla CSS, but you never hear about because of things like Sass.

I'd say the biggest reason why Sass is so popular (and why you should use it) is because it keeps CSS DRY, much more so than vanilla ever can. If you think about it, that's what Sass is doing. Storing values in variables, storing styles in mixins, calculating values with functions, that's all about keeping your code DRY. Stacking them on top of each other basically turns Sass into a programming language.

Ruby (which is what the Sass compiler is built in) seems to favor POSIX platforms above Windows, and that's really too bad. Maybe its Node cousins (LESS or Stylus) will work better for you. LESS doesn't have a lot of the directive features that Sass does, but Stylus does. I've considered switching to Stylus sometimes myself, due to the Ruby-ish syntax.

Anyway, hope that helps!

Hi Ryan Duchene,

I got it working by putting the scss file within a folder in desktop. Then had my terminal target that specific directory. I guess if you have scss on the desktop the terminal doesn't update because of other files within the desktop directory.

Thanks for the help though.

Herb Bresnan
Herb Bresnan
10,658 Points

Wow! The fog lifted! I have Sass up and running, and more importantly, I understand. Your explanation gave a push to keep working on it.
Thank you.