We initially supported C-style comments because I wrote the very first version of the parser and it was the easiest thing to parse for me since I am a big old blockhead. Then we allowed inline comments because libraries using SassDoc such as SassyLists output C-style comments, polluting the user's CSS. This was especially relevant in online playgrounds such as SassMeister.
I cannot find a good reason to use C-style over inline comments for SassDoc. They are longer and likely to be confusing in regard to usual CSS comments. Also, there are case where C-style comments simply fail:
/**
* The CSS selector for a special button.
*
* @example
* #{$special-button-selector} {
* font-weight: bold;
* }
*
*/
$special-button-selector: '.button.special-button';
Undefined variable: "$special-button-selector".
Also it might be worth nothing that both CSS Guidelines and Sass Guidelines recommend using inline comments when documenting Sass code. It makes sense. C-style is for CSS, inline for Sass.
Back to my initial idea: what if we dropped C-style comments altogether? Having a single type of documentation is enough and less confusing for the end user. Also, allowing C-style comments for SassDoc might encourage library authors to pollute users' CSS with massive comment blocks.
@SassDoc/owners What do you think?
PS: this is now or never. API break.
We initially supported C-style comments because I wrote the very first version of the parser and it was the easiest thing to parse for me since I am a big old blockhead. Then we allowed inline comments because libraries using SassDoc such as SassyLists output C-style comments, polluting the user's CSS. This was especially relevant in online playgrounds such as SassMeister.
I cannot find a good reason to use C-style over inline comments for SassDoc. They are longer and likely to be confusing in regard to usual CSS comments. Also, there are case where C-style comments simply fail:
Also it might be worth nothing that both CSS Guidelines and Sass Guidelines recommend using inline comments when documenting Sass code. It makes sense. C-style is for CSS, inline for Sass.
Back to my initial idea: what if we dropped C-style comments altogether? Having a single type of documentation is enough and less confusing for the end user. Also, allowing C-style comments for SassDoc might encourage library authors to pollute users' CSS with massive comment blocks.
@SassDoc/owners What do you think?
PS: this is now or never. API break.