Class CssParser
- Namespace
- SimpleSign.HtmlToPdf.Parsing
- Assembly
- SimpleSign.HtmlToPdf.dll
Parses CSS from <style> blocks and inline style attributes. Supports tag, .class, #id selectors, shorthand properties, and common length units.
public static class CssParser
- Inheritance
-
CssParser
- Inherited Members
Methods
CalculateSpecificity(string)
Calculates specificity of a CSS selector.
public static int CalculateSpecificity(string selector)
Parameters
selectorstring
Returns
ParseInlineStyle(string)
Parses an inline style attribute value into properties.
public static Dictionary<string, string> ParseInlineStyle(string style)
Parameters
stylestring
Returns
ParseLength(string, float)
Parses a CSS length value to points. Returns null if unparseable. Percentages are returned as negative values for later resolution.
public static float? ParseLength(string value, float parentFontSize = 12)
Parameters
Returns
ParseStylesheet(string)
Parses a CSS stylesheet string into a list of rules.
public static List<CssRule> ParseStylesheet(string css)
Parameters
cssstring