Class ThemeMarkupStyleResolver
Theme-backed IMarkupStyleResolver exposing the curated framework semantic markup
tokens plus, optionally, an app's registered custom semantic styles. Each framework token maps
to a ThemeStyle and a channel mode; colours come from
Resolve(ThemeStyle), so the same markup renders differently per theme. Only
the curated subset is exposed — table-only ink/surface tokens are intentionally absent. Custom
styles (CliCustomStyle) resolve through their base ThemeStyle with
optional family/theme overrides; their names can never collide with framework tokens (the custom
style registry rejects such names), so framework tokens are matched first.
public sealed class ThemeMarkupStyleResolver : IMarkupStyleResolver
- Inheritance
-
ThemeMarkupStyleResolver
- Implements
- Inherited Members
Constructors
ThemeMarkupStyleResolver(ITheme)
Creates a resolver for framework semantic tokens using the supplied theme.
public ThemeMarkupStyleResolver(ITheme theme)
Parameters
themeITheme- The theme used to resolve semantic styles.
ThemeMarkupStyleResolver(ITheme, TigerCustomStyleRegistry?)
Creates a resolver that resolves framework tokens through
theme and, when
supplied, an app's registered custom semantic styles through the same theme.public ThemeMarkupStyleResolver(ITheme theme, TigerCustomStyleRegistry? customStyles)
Parameters
themeIThemecustomStylesTigerCustomStyleRegistry
Properties
FrameworkTokenNames
The framework semantic token names (case-insensitive). Snapshot.
public static IReadOnlyCollection<string> FrameworkTokenNames { get; }
Property Value
Methods
IsFrameworkToken(string?)
True when
name is a curated framework semantic token (case-insensitive).public static bool IsFrameworkToken(string? name)
Parameters
namestring
Returns
IsHyperlinkToken(string)
Returns
true when name (case-insensitive) is a hyperlink token —
a semantic style whose span's visible text is also its hyperlink target (e.g. Link).
When the parser sees such a token it derives the target from the span's visible text and
rejects nesting another hyperlink token inside it. Defaults to false so existing
resolvers need no change; only link-aware resolvers override it.public bool IsHyperlinkToken(string name)
Parameters
namestring
Returns
TryResolve(string, out CliColor?, out CliColor?, out CliTextDecoration)
Tries to resolve
name (case-insensitive) to a semantic style. Returns
false for names that are not curated semantic tokens, so the parser can fall back
to raw colour parsing. A null channel means "inherit": foreground-only tokens
return a null background so the surrounding background is preserved.
decorations carries any bold/italic/underline flags the semantic style
defines; None when it defines none. The parser ORs these
onto the surrounding effective decorations.public bool TryResolve(string name, out CliColor? foreground, out CliColor? background, out CliTextDecoration decorations)
Parameters
namestringforegroundCliColor?backgroundCliColor?decorationsCliTextDecoration