Documentation
¶
Index ¶
Constants ¶
View Source
const MaxManifestBytes = 512 * 1024
View Source
const PaletteVersion = 1
View Source
const Version = 1
Variables ¶
This section is empty.
Functions ¶
func CSS ¶
func CSS(c *Catalog, profiles ...ResolvedTheme) (string, error)
CSS emits only validated tokens. It does not load or compile workspace CSS. Passing a catalog not produced by Resolve still validates selector/value input. Profiles supply the full catalog when the style service emits one theme at a time.
Types ¶
type Catalog ¶
type Catalog struct {
Fonts []PublishedFontFamily `json:"fonts,omitempty"`
Version int `json:"version"`
PaletteVersion int `json:"paletteVersion"`
DefaultTheme string `json:"defaultTheme"`
DefaultMode string `json:"defaultMode"`
Themes []ResolvedTheme `json:"themes"`
}
type FontFace ¶ added in v0.1.55
type FontFace struct {
File string `json:"file" yaml:"file"`
NativeFile string `json:"nativeFile,omitempty" yaml:"nativeFile,omitempty"`
Style string `json:"style" yaml:"style"`
Weight string `json:"weight" yaml:"weight"`
UnicodeRange string `json:"unicodeRange,omitempty" yaml:"unicodeRange,omitempty"`
}
type FontFamily ¶ added in v0.1.55
type Manifest ¶
type Manifest struct {
Overrides []string `json:"overrides,omitempty" yaml:"overrides,omitempty"`
Version int `json:"version" yaml:"version"`
Fonts []FontFamily `json:"fonts,omitempty" yaml:"fonts,omitempty"`
Files []string `json:"files,omitempty" yaml:"files,omitempty"`
DefaultTheme string `json:"defaultTheme,omitempty" yaml:"defaultTheme,omitempty"`
DefaultMode string `json:"defaultMode,omitempty" yaml:"defaultMode,omitempty"`
Themes []Theme `json:"themes,omitempty" yaml:"themes,omitempty"`
}
type PublishedFontAsset ¶ added in v0.1.57
type PublishedFontAsset struct {
Href string `json:"href"`
Format string `json:"format"`
SHA256 string `json:"sha256"`
SizeBytes int `json:"sizeBytes"`
}
PublishedFontAsset is a contained, authenticated, content-addressed asset.
type PublishedFontFace ¶ added in v0.1.57
type PublishedFontFace struct {
Style string `json:"style"`
Weight string `json:"weight"`
UnicodeRange string `json:"unicodeRange,omitempty"`
Web PublishedFontAsset `json:"web"`
Native *PublishedFontAsset `json:"native,omitempty"`
}
type PublishedFontFamily ¶ added in v0.1.57
type PublishedFontFamily struct {
Role string `json:"role"`
Name string `json:"name"`
Fallback string `json:"fallback,omitempty"`
Faces []PublishedFontFace `json:"faces"`
}
type ResolvedTheme ¶
type ResolvedTheme struct {
ID string `json:"id"`
Label string `json:"label"`
FallbackMode string `json:"fallbackMode"`
Modes map[string]Tokens `json:"modes"`
Presentations map[string]string `json:"presentations,omitempty"`
}
func (ResolvedTheme) EffectiveMode ¶
func (t ResolvedTheme) EffectiveMode(preference, systemMode string) string
EffectiveMode implements the same fallback rule expected of all clients.
type Theme ¶
type Theme struct {
ID string `json:"id" yaml:"id"`
Label string `json:"label" yaml:"label"`
FallbackMode string `json:"fallbackMode" yaml:"fallbackMode"`
Tokens Tokens `json:"tokens,omitempty" yaml:"tokens,omitempty"`
Files []string `json:"files,omitempty" yaml:"files,omitempty"`
Modes map[string]Variant `json:"modes" yaml:"modes"`
Presentations map[string]string `json:"presentations,omitempty" yaml:"presentations,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.