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 Sass Basics Getting Started with Sass Naming Variables

Sass and camelCasing

Hey guys

Why is it bad practice to use camelCasing in SASS? I already use it for JS and jQuery. Wouldn't it be easier for me to keep the same style of coding across as many different languages as possible so I don't trip myself up?

Thanks in advance


1 Answer

Rich Salvucci
Rich Salvucci
16,716 Points

Hi Paul,

The reason that it is suggested you use hyphenated name is because that this what is in the SASS style guide, as well as many others, such as Air BNB for example https://github.com/airbnb/css#syntax. The code you wrote with camelCase would compile fine, but would be less readable for other developers when they go to look at it, because that is not the accepted best practice for the language. It is also more in line with other naming conventions for CSS such as BEM http://getbem.com/introduction/


I'll try and get into the habit. Thanks a lot