StubThemeContext Class#
Stub IThemeContext that returns default light-theme values from ThemeColorTokens, ThemeTypography, and ThemeSpacing.
public sealed class StubThemeContext : Verso.Abstractions.IThemeContext
Inheritance System.Object → StubThemeContext
Implements IThemeContext
Properties#
ThemeKind Property#
Gets the current theme kind (e.g., light or dark).
public Verso.Abstractions.ThemeKind ThemeKind { get; }
Implements ThemeKind
Property Value#
Methods#
GetColor(string) Method#
Resolves a named color token to its current theme value.
public string GetColor(string tokenName);
Parameters#
tokenName System.String
The color token name to resolve.
Implements GetColor(string)
Returns#
System.String
The color value as a string (e.g., a hex color code).
GetCustomToken(string) Method#
Retrieves a custom theme token value by key.
public string? GetCustomToken(string key);
Parameters#
key System.String
The custom token key.
Implements GetCustomToken(string)
Returns#
System.String
The token value as a string, or null if the key is not defined.
GetFont(string) Method#
Retrieves the font descriptor for the specified font role.
public Verso.Abstractions.FontDescriptor GetFont(string fontRole);
Parameters#
fontRole System.String
The font role identifier (e.g., "body", "code").
Implements GetFont(string)
Returns#
FontDescriptor
A FontDescriptor containing the font family, size, and weight.
GetSpacing(string) Method#
Retrieves the spacing value for the specified spacing token.
public double GetSpacing(string spacingName);
Parameters#
spacingName System.String
The spacing token name to resolve.
Implements GetSpacing(string)
Returns#
System.Double
The spacing value in device-independent units.
GetSyntaxColor(string) Method#
Resolves a syntax-highlighting token type to its color value.
public string? GetSyntaxColor(string tokenType);
Parameters#
tokenType System.String
The syntax token type (e.g., "keyword", "string").
Implements GetSyntaxColor(string)
Returns#
System.String
The color value as a string, or null if the token type is not defined.