I'm using ExCSS to parse and manipulate a stylesheet string. So far so good.
But I can't find any documentation on how to convert the manipulated style rules into a string.
Although the code may not be relevant to this question, this is what I'm doing:
private string ManipulateCSS(string styles)
{
ExCSS.Parser parser = new ExCSS.Parser();
var stylesheet = parser.Parse(styles);
// here I perform specific manipulations
// which are not relevant to this question...
stylesheet.StyleRules
.SelectMany(r => r.Declarations)
.Where(d => d.Name == "<something>"
...
...
// Now, the next line is where I'm having issues:
// how to return the whole string with styles out of this ExCSS parser?
return stylesheet.StyleRules.ToString();
}
Thank you for your help!