Skip to main content

Module css

Module css 

Source
Expand description

CSS subset parser for EPUB styling

Parses a minimal subset of CSS sufficient for EPUB rendering:

  • Font properties: font-size, font-family, font-weight, font-style
  • Text: text-align, line-height, letter-spacing
  • Spacing: margin-top, margin-bottom
  • Selectors: tag, class, and inline style attributes

Complex selectors, floats, positioning, and grid are out of scope.

Structs§

CssRule
A single CSS rule (selector + declarations)
CssStyle
A set of CSS property values
Stylesheet
A parsed CSS stylesheet

Enums§

CssSelector
A CSS selector (subset)
FontSize
Font size value
FontStyle
Font style
FontWeight
Font weight
LineHeight
Line height value
TextAlign
Text alignment

Functions§

parse_inline_style
Parse an inline style attribute value into a CssStyle
parse_stylesheet
Parse a CSS stylesheet string into a Stylesheet