Skip to content

Instantly share code, notes, and snippets.

@KevinGimbel
Created January 15, 2014 13:02
Show Gist options
  • Save KevinGimbel/8435781 to your computer and use it in GitHub Desktop.
Save KevinGimbel/8435781 to your computer and use it in GitHub Desktop.
Hey Iris! I summed up comments in Scss (and CSS) for you so you can safely remove them from your current CSS. :)
Types of Comments in (S)CSS:
/*
Standard multi-line comment.
This is the most used I'd say.
Though this is pretty awesome while developing, it should be removed for production.
*/
/*
Normaly, "//" is a single line comment but in CSS it's a a bit tricky.
In fact, they're not single line at all, they comment out the NEXT block if it's
not in front of a CSS property.
*/
.foo {
// width: 10em; <-- commented out only width: 10em
height: 50em;
}
// commented out the NEXT rule - so it's .bar {} which is commented out
.bar {
height:10em;
}
/*
The Special COMPASS Comment.
When you set line_comments = false in your config.rb it will remove all comments
expect special declared comment with a "!" after the first /*
*/
Example of Special Compass Comments:
/*!
This comment will stay in the compiled css - useful when developing for WordPress. ;)
All other comments will be removed.
*/
So simply put all your WordPress Theme Description Stuff between /*! */ instead of /**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment