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

General Discussion

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

CSS Comments

Every so often when I'm writing CSS code and doing comments for my code, I like to use them to blank out certain rules, or little notes around code blocks.

And I just wonder, why is there nothing in the specificaton for single line comments.

You can make single line comments in pretty much every programming language I'm aware of but if there's any language, markup or otherwise that is set up for single line comments, it is CSS.

Does this bug anyone else? Anyone know if this is something they might bring in in the future? (Long shot I know)

2 Answers

I hear you Jonathan. Many CSS extension languages like SASS do provide single-line comments as it's definitely a bit of an annoyance. Obviously there are many more compelling reasons to use one of these languages, but that ability alone doesn't hurt. :)

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

Is it easy to integrate SASS into a CSS file to do this? I'd love to be able to do something to apply single line comments right away :-)

While it's definitely not as easy as just opening up a text editor and writing CSS we do have a course on getting started with SASS. If you're looking to follow along with vanilla CSS examples i'd recommend looking in to SCSS (it comes with SASS and is just an alternative syntax). It looks a lot more like CSS and may be easier of a transition.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

I'm looking forward to tacking SASS for the first time in the web design track. Just have to get SEO and Illustrator out the way first lol