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

Jacek Grzegorczyk
Jacek Grzegorczyk
8,974 Points

Modular Sass - few questions about project setup.

I have recently went through Modular Sass Videos and there are some things i find uncomfortable:

  1. 30 scss files with different styles
  2. A lot of unique names for mixins, functions, extends.
  3. Replacing every single line of code just to use %extends and @includes (which look even more messy) needs a lot of practice to learn your unique names for all of those elements.
  4. Is one big "scss" file really so awful? I find everything with ctrl+f within seconds and i don't have to remember what i have in other 30 files (and my team members don't have to remember it aswell).

I think that very big projects can use that kind of workflow, but for smaller projects it's a mess. Even if you work in a team - all people should use same names, same methodology (like BEM) etc. to make work consistent. And if you change your job? you have to learn everything from scratch.

Is there any "golden rule" for sass structure ? Or some "base" structure with the most common mixins, functions ?

Have you found any good patters for folder/scss structure + mixins/functions etc?

James Home
James Home
12,011 Points
  • A big file is very bad, especially in a big team. Multiple people can come in and replicate/override the CSS
  • The 30 files have to be logically organised, use folders if necessary
  • I would advise avoiding % as they can be misused very easily

You should always be learning and there's no rules because not every project is the same. If you want to start thinking in a particular direction, try this: https://smacss.com/