public override string ToString() { var sb = StringBuilderCache.Aquire(); using var sw = new StringWriter(sb); var writer = new CssWriter(sw); writer.WriteStyleRule(this, 0); return(StringBuilderCache.ExtractAndRelease(sb)); }
public void WriteTo(TextWriter textWriter, IEnumerable <KeyValuePair <string, CssValue> > variables) { var scope = new CssScope(); foreach (var v in variables) { scope.Add(v.Key, v.Value); } var writer = new CssWriter(textWriter, Context, scope, resolver); writer.WriteRoot(this); }
public override string ToString() { var sb = new StringBuilder(); using (var sw = new StringWriter(sb)) { var writer = new CssWriter(sw); writer.WriteStyleRule(this, 0); return sb.ToString(); } }
public void WriteTo(TextWriter textWriter) { var writer = new CssWriter(textWriter, Context, new CssScope(), resolver); writer.WriteRoot(this); }
public void WriteTo(TextWriter textWriter, IEnumerable<KeyValuePair<string, CssValue>> variables) { var scope = new CssScope(); foreach (var v in variables) { scope.Add(v.Key, v.Value); } var writer = new CssWriter(textWriter, Context, scope, resolver); writer.WriteRoot(this); }