Keep comments in `CssStyleSheet`
It seems that CSS comments are not kept in the CSSOM and thus are not preserved when you call ToCss() on a previously parsed CssStyleSheet object.
var html = @"<style> /* Set text color to red */ h1{color:red}</style>";
var parser = new HtmlParser(new HtmlParserOptions(), BrowsingContext.New(Configuration.Default.WithCss(new CssParserOptions())));
var dom = parser.ParseDocument(html);
var styleSheet = dom.StyleSheets[0] as ICssStyleSheet;
var css = styleSheet.ToCss(); // -> "h1 { color: rgba(255, 0, 0, 1) }"
Well, there is no such thing in the CSSOM; we collect all that into "trivia" (a technique popularized by Roslyn). The ToCss serialization only works on the CSSOM -> so in order to serialize with the comments something else would need to be serialized (or the CSSOM would need to be extended / changed).
Potentially, a flag could be introduced, but even then I am not sure how these comments would be attached. Maybe they would be attached to the stylesheet itself with a reference "where" they should be placed (this "where" is a big problem; in this OM things may be added, removed, changed, ... - I guess any change would then need to reset / remove / alter the comments?).
I realize this is a non-trivial endeavour, in particular the "where" part you mentioned. Unlike in HTML, comments in CSS can be arbitrarily interleaved with other tokens (e.g. background-color: /* black */ #000;) so this would need to be reflected in the OM as well. Feel free to close this.