Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages loading, caching, and retrieval of themes.
func NewStore ¶
NewStore creates a Store backed by the given filesystem. Pass nil for a registry-only store with no filesystem.
func (*Store) LoadedThemes ¶
LoadedThemes returns the names of all currently cached themes, sorted.
type Theme ¶
type Theme struct {
Name string
DisplayName string
Type string // "dark" or "light"
Colors map[string]string
TokenColors []TokenColor
DefaultForeground string
DefaultBackground string
}
Theme represents a parsed VS Code color theme.
func (*Theme) Base ¶
func (t *Theme) Base() TokenSettings
Base returns the default foreground/background as a TokenSettings.
func (*Theme) Match ¶
func (t *Theme) Match(scopes []string) TokenSettings
Match resolves the style for a token with the given scope stack. scopes[0] is the root scope, scopes[len-1] is the most specific. Each property (foreground, background, fontStyle) is taken from the highest-scoring matching rule that defines it.
type TokenColor ¶
type TokenColor struct {
Scopes []string
Settings TokenSettings
// contains filtered or unexported fields
}
TokenColor is a single rule mapping scope selectors to style settings.
type TokenSettings ¶
TokenSettings holds style properties for a scope match.