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 trialpaulscanlon
Courses Plus Student 26,735 PointsSass 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
16,716 PointsHi 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
paulscanlon
Courses Plus Student 26,735 Pointspaulscanlon
Courses Plus Student 26,735 PointsI'll try and get into the habit. Thanks a lot
Paul