Variant Type — astro Architecture
Architecture documentation for the Variant type/interface in local.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD e00fed2e_95d3_8917_0e98_dcf521712bf8["Variant"] 58255ece_c750_2cc1_8857_7a8e6a866fc7["local.ts"] e00fed2e_95d3_8917_0e98_dcf521712bf8 -->|defined in| 58255ece_c750_2cc1_8857_7a8e6a866fc7 style e00fed2e_95d3_8917_0e98_dcf521712bf8 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/assets/fonts/providers/local.ts lines 27–57
interface Variant extends FamilyProperties {
/**
* Font [sources](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src). It can be a path relative to the root, a package import or a URL. URLs are particularly useful if you inject local fonts through an integration.
*
* We recommend not putting your font files in [the `public/` directory](/en/reference/configuration-reference/#publicdir). Since Astro will copy these files into that folder at build time, this will result in duplicated files
* in your build output. Instead, store them somewhere else in your project, such as in `src/`.
*
* You can also specify a [tech](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src#tech) by providing objects:
*
* ```js
* src: [{ url:"./src/assets/fonts/MyFont.woff2", tech: "color-COLRv1" }]
* ```
*/
src: [RawSource, ...Array<RawSource>];
/**
* A [font weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight). If the associated font is a [variable font](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/Variable_fonts_guide), you can specify a range of weights:
*
* ```js
* weight: "100 900"
* ```
*
* When the value is not set, by default Astro will try to infer the value based on the first source.
*/
weight?: Weight | undefined;
/**
* A [font style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style).
*
* When the value is not set, by default Astro will try to infer the value based on the first source.
*/
style?: Style | undefined;
}
Source
Frequently Asked Questions
What is the Variant type?
Variant is a type/interface in the astro codebase, defined in packages/astro/src/assets/fonts/providers/local.ts.
Where is Variant defined?
Variant is defined in packages/astro/src/assets/fonts/providers/local.ts at line 27.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free