Property StylesheetWriter
StylesheetWriter
Gets or sets a receiver for the generated stylesheet in Linked mode. Null — the default — leaves StylesheetHref in charge.
public IHtmlResourceWriter? StylesheetWriter { get; set; }
Property Value
Remarks
This exists for the same reason XhtmlSyntax does: a packaging
format needs the stylesheet as a file, not as an inline <style> repeated in
every content document. EPUB is the caller — one stylesheet.css shared by every
chapter — and the alternative was for the packager to reimplement the DOM-to-CSS
mapping, which would drift from the one the documents themselves were written
against.
When set, the writer builds the stylesheet, hands it over and links to the href that comes back, which takes precedence over StylesheetHref. If the receiver declines by returning null, the styles are emitted inline instead: a document that silently lost its styling would be worse than one carrying it twice.