ViteFonts
class ViteFonts (View source)
Properties
| static protected array<string,array<string,mixed>> | $manifests | The cached font manifests. |
Methods
Read the font manifest for the given configuration.
Read and decode a manifest file.
Resolve the CSS content from the manifest.
Resolve filtered CSS content using per-alias fragments from the manifest.
Build a :root block containing only the CSS variables for the given aliases.
Read a CSS file from the build directory.
Validate the font manifest structure.
Validate that the requested aliases exist in the manifest.
Validate that each preload entry contains the required keys.
Flush cached manifests.
Details
array<string,mixed>|null
manifest(bool $isHot, string $buildDirectory, string $manifestFilename, string $hotFile)
Read the font manifest for the given configuration.
protected array<string,mixed>|null
readManifest(string $path)
Read and decode a manifest file.
string
resolveStyleContent(array $manifest, array|null $aliases, string $buildDirectory)
Resolve the CSS content from the manifest.
protected string
resolveFilteredStyleContent(array $style, array $aliases)
Resolve filtered CSS content using per-alias fragments from the manifest.
protected string
filterVariables(array $variables, array $aliases)
Build a :root block containing only the CSS variables for the given aliases.
protected string
readStyleFile(string $buildDirectory, string $file)
Read a CSS file from the build directory.
void
ensureValidManifest(array $manifest)
Validate the font manifest structure.
void
ensureValidFamilies(array $aliases, array $manifest)
Validate that the requested aliases exist in the manifest.
void
ensureValidPreloads(array $preloads, bool $isHot)
Validate that each preload entry contains the required keys.
void
flush()
Flush cached manifests.