ThemeCss Class#
Builds the :root { --verso-*: ...; } custom property block that Verso surfaces
style themselves from.
public static class ThemeCss
Inheritance System.Object → ThemeCss
Remarks#
There is one emitter rather than one per surface. The notebook interface and the
self-contained HTML export need the same block, and while each kept its own copy the two
drifted: the export never emitted the typography tokens that are not fonts, so
--verso-font-family-mono, --verso-font-family-sans and
--verso-font-size-base were missing from every exported document.
Every number is written with the invariant culture. A stylesheet is not read in anyone's
language: a length is 1.4 whoever is looking at it, never 1,4, and a browser
discards a declaration it cannot parse. Callers cannot get this wrong by accident because
they never format a number themselves.
Methods#
BuildRootBlock(ITheme) Method#
Builds the custom property block for a theme, falling back to the default tokens for anything the theme does not supply.
public static string BuildRootBlock(Verso.Abstractions.ITheme? theme);
Parameters#
theme ITheme
Returns#
BuildRootBlock(ThemeColorTokens, ThemeTypography, ThemeSpacing, ThemeElevation) Method#
Builds the custom property block from individual token groups, falling back to the
defaults for any group that is null.
public static string BuildRootBlock(Verso.Abstractions.ThemeColorTokens? colors, Verso.Abstractions.ThemeTypography? typography, Verso.Abstractions.ThemeSpacing? spacing, Verso.Abstractions.ThemeElevation? elevation);
Parameters#
colors ThemeColorTokens
typography ThemeTypography
spacing ThemeSpacing
elevation ThemeElevation