ferrum-email-core
The foundation crate for the Ferrum Email framework.
What's Inside
Componenttrait — the core abstraction. Every email template and reusable element implements this.Nodetree — the intermediate representation between components and rendered HTML. Consists ofElement,Text,Fragment, andNonevariants.Stylesystem — type-safe CSS properties (color,font-size,padding, etc.) with ato_css()method for inline style generation.Color— hex, RGB, RGBA, named, and transparent color values.Spacing— padding/margin withall(),xy(),new()constructors.- Primitive types —
Px,Percent,SizeValue,FontWeight,TextAlign,VerticalAlign,FontFamily,LineHeight,Display,BorderStyle,TextDecoration,HeadingLevel.
Usage
use ;
;
Design
The Node tree is intentionally simple — it's a direct mapping to HTML elements with typed attributes and styles. This keeps the renderer straightforward while giving components full control over their output.
All style values are type-checked at compile time. You cannot construct invalid CSS values — Px(16) renders to "16px", Color::hex("ff0000") renders to "#ff0000", etc.
License
MIT OR Apache-2.0