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 trialChris Stauffer
Courses Plus Student 786 PointsDoes every Sass file really need to end in .SCSS?
In "Installing and Using Sass" Hampton says that every Sass file ends in .scss, is this true? I've been working in Sass for some awhile now and have always ended my files in .sass and compiled just fine.
3 Answers
Kevin Korte
28,149 PointsIf you want to continue to use the indented syntax, than yes your files need to end in .sass. The video lesson only focused on the .scss bracket syntax, and assumed the user had not used sass before. You'll notice they never touched the indent syntax version of it.
Whether you name your files .sass or .scss will determine what syntax the parser expects. That hasn't changed that I'm aware of.
Ajinkya Borade
Courses Plus Student 16,635 PointsYes. so that your compiler can convert it into NAME.css file. the real extension of SASS is .scss and its widely used.
Chris Stauffer
Courses Plus Student 786 PointsI prefer the older indented syntax, can I still end my files with .scss? (http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax)
Would I be better off converting to the new syntax?
Paul Graham
1,396 PointsProbably. While I think the legacy syntax is superior almost all new Sass code is written in Sassy CSS because it's compatible with vanilla CSS. The syntax also builds on CSS in a very smart way enabling new people to digest Sass concepts and your code very quickly.
The biggest problem though is that you can't do @imports
on vanilla CSS and have those files compiled as SCSS. With SCSS syntax, this does happen. I find myself all the time needing to include a Bower file like Normalize and it's kind of a pain with legacy Sass. I can always rename a file with .scss
extension, but then I'm destroying the entire point of Bower.
You can always convert these back and forth at will from the command line so you're not stuck with manually converting a bunch of legacy Sass code if you want to move over.
Chris Stauffer
Courses Plus Student 786 PointsCurrently I'm the only CSS developer on my team. So at this point, what CSS preprocessor we use is my prerogative. But it's good to know that if I run into compatibility issues down the road we have the ability to convert back and forth. Thanks for your thoughts.
Chris Stauffer
Courses Plus Student 786 PointsChris Stauffer
Courses Plus Student 786 PointsCopy, this is a fun read: http://thesassway.com/articles/sass-vs-scss-which-syntax-is-better