resource / Front-End-Standards

Front-end development standards for Resource.
MIT License
23 stars 1 forks source link

Add details on when to use "multiple line" vs "single line" comment #52

Closed nicetransition closed 11 years ago

nicetransition commented 11 years ago

We should add details on when to use "multiple line" vs "single line" comment for CSS documentation and SASS.

Side note: SASS should then also include when to use // Comment

LukeAskew commented 11 years ago

Suggested guideline?

nicetransition commented 11 years ago

Multiline comments are preserved in the CSS output where possible, while the single-line comments (// comment) )are removed. Single line (// comment) are removed no matter the compression style type value (even if using --style expanded) Single line are best used for single-line of a code reference that you do not want to output in your code and can be used as additional note or reference to a line of SASS.

When the first letter of a comment is !, the comment will be interpolated and always rendered into css output even in compressed output modes. This is useful for adding Copyright notices to your generated CSS.

nicetransition commented 11 years ago

Something like that?

but also (FYI)

.selector {
    key: value; /* comment will be removed */
    key: value;
    /* comment will not be removed */
}

Single line /* must be on a new line not to be removed as // comment is.