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 CSS to Sass Refactoring with Sass Finishing and Importing our Partials

Pavlo Kochubei
Pavlo Kochubei
15,009 Points

Sass partial naming techniques.

Wouldn't it be better to name the index files with their corresponding function name. For example, index.scss from components folder would be components.scss?

Any other ideas on organizing your sass projects?

Found this article - http://www.sitepoint.com/architecture-sass-project/

2 Answers

LaVaughn Haynes
LaVaughn Haynes
12,397 Points

Personally, I usually have an "index" sass file (of the same name as it's parent folder) that imports all of it's sibling partials. Then in my main file I only need to import 1 file per folder. For example in my main.sass (yes, I prefer sass over scss) I might include the "components/_components.sass" partial. That partial will import all of its sibling partials (_buttons, _navigation, etc). I think that's easier to manage.

Pavlo Kochubei
Pavlo Kochubei
15,009 Points

Yea, that seems natural to do so. Thanks for confirmation. I've only glanced at sass syntax , so can't comment yet - it reminded me of CoffeScript though.

LaVaughn Haynes
LaVaughn Haynes
12,397 Points

The individual that exposed me to it just happened to prefer the sass syntax so thats what I learned first. I'm cool with Jade which is basically the HTML equivalent of Sass. I never felt comfortable enough with vanilla JavaScript to try CoffeeScript though. I think that layer of abstraction with JS is harder for me to process.