Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Paul

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/

-Rich

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

Paul