Certain comments is breaking the parser and hex colours are converted to rgb colours
I noticed that when I use EXCSS, when I have a comment with //, it won't apply the CSS class just below it.
I also noticed that it will convert hex colours to rgb colours. Is there a setting to disable this?
Colours are canonicalised to RGA{A} when ToString() is called on a parsed colour value and there's no way to configure that as far as I can tell.
You could try accessing the Original property instead of Value to get the value as it appeared in the parsed input.
We could consider preserving the original color, but I'm not sure I understand the value in doing so. Parsers like ExCSS generate an AST designed to normalize conventions into a single, common form. There is no informational difference between RGB, hex and well as other colors formats. For example, these 3 values are equivalent:
Hex: #DACA45; RGB: rgb(218, 202, 69); HSL: hsl(54, 67%, 56%);
It's a matter of personal preference. I tend to favor RGB since it can optionally include an alpha channel as a 4th parameter to handle opacity.
It's simple to convert RGB to hex. Take a look at the ExCSS code for examples. The hexidecimal format string makes conversion trivial:
$"{r:X2}{g:X2}{b:X2}"
The main reason for the requirement for Hex colours is because we use it to generate Inline CSS styling for newsletter templates. Some older email clients like Outlook doesn’t support rgb or rgba.