Overview
graphitepdf-stylesheet provides CSS-like style maps, flattening, media-query resolution, unit normalization, and property expansion for GraphitePDF.
Scope
graphitepdf-stylesheet contains:
Style,StyleValue, andStylesheetContainerandOrientationfor environment-dependent resolutionflatten(),resolve_media_queries(),resolve_style(), andresolve_styles()- color normalization helpers such as
transform_color()
Installation
API Summary
| Category | Items |
|---|---|
| Style model | Style, SafeStyle, ExpandedStyle, StyleValue |
| Resolution context | Container, Orientation |
| Stylesheets | Stylesheet |
| Resolution helpers | flatten(), resolve_media_queries(), resolve_style(), resolve_styles(), transform_color() |
Example
use ;
Design Principles
- keep stylesheet behavior deterministic and data-oriented
- separate CSS-like resolution from layout and rendering crates
- expose flattening and resolution as ordinary functions
- keep the crate useful outside of PDF-specific code paths
Role In GraphitePDF
This crate sits in the shared-services layer and feeds resolved style data into layout, style, document, and the root facade.
License
MIT