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

Doesn't SMACSS conflict with Sass

SMACSS is a great way to organize code, however, I find that there is a conflict with this system of organization and the concept of nesting in Sass. For example, if you are following the guidelines for SMACSS you will place your media queries under the "State" category. But if I wanted to nest a media queries directly in a module rule wouldn't that be a violation of those guidelines?

.navbar {
     padding: 20px;
     @media (min-width: 800px) {
          padding: 40px;
     }
}

.navbar would fall under the "Modules" category. But here I am making a state change. A total violation of SMACCS.

1 Answer

Sass is just meant to make it quicker than writing plain CSS, particularly with the use of variables, etc.

I think it can still achieve that, even if you don't take advantage of all of its features.

In fact, the nesting in Sass is one of the features that is probably being used less and less these days as more people adopt approaches that call for less nesting and more specific naming of classes, etc.

Anyways, you're probably right in your example, but you could still use the nesting of Sass for things like pseudo-elements/selectors, etc.