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

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

Your approach to this?

HI,

If you look at this site http://ashley-bootstrap3-website-template.little-neko.com/v1.8/files/index.html

What would be YOUR approach to make Sass folder structure?

Would you use something like BEM and such as well?

But mainly I'm about file structure, or folder.

1 Answer

Garrett Sanderson
Garrett Sanderson
12,735 Points

Normally how I break up my sass style sheets is by component and or pages.

Normally I have a directory for the main page styles for each template and then anything that is a module in a page I put in a directory called partials so that they are easier to find. So that could be anything like a carousel, google map, image gallery, tabs, etc.

But since this is only a one page site I think just having the partials directory would be fine.

You can look at this website for answers on best practice structure for Sass.

Example

-scss
    -/pages
        -_home.scss
        -_about.scss
        -_news.scss
    - /partials
        -_home-page-slider.scss
        -_abous-us.scss
        - /_mixins.scss
        -/_variables.scss
        -/_base.scss
    - index.scss
Aurelian Spodarec
Aurelian Spodarec
10,801 Points

Thank you :)

This was my approach to the folder structure. In the pages I woudl put different section of the pages, or if this was a non parallax site, i would put pages there instead.

Sass site has a bit different structure then Guil etc.. and so I think i get to understand this better, but then, i though it would be good to see the approach from a professional or someone that knows this better than me. But thank you