Mapped Font Style (mapped_style
)
Mapped font modules provide more control over the importing of an SCSS module with fonts. Add
each item as a map with the import_name
key defined.
JSON Schema
Definition
{
"$id": "https://platen.io/modules/platen/config/site/theme/fonts/mapped_style/schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"default": [
{
"import_name": "roboto"
}
],
"description": "Specify a map for more control over the importing of the SCSS module with the fonts.\n\nhttps://platen.io/modules/platen/config/site/theme/fonts/mapped_style/",
"properties": {
"import_name": {
"description": "Specify the import name of the SCSS module.\n\nhttps://platen.io/modules/platen/config/site/theme/fonts/mapped_style/#import_name",
"title": "Import Name",
"type": "string"
},
"weight": {
"description": "Specify the weight of the SCSS module.\n\nhttps://platen.io/modules/platen/config/site/theme/fonts/mapped_style/#weight",
"title": "Weight",
"type": "integer"
}
},
"required": [
"import_name"
],
"title": "Mapped Font Style",
"type": "object"
}
<h2 id="mapped_style.default">Default Value</h2>
[
{
"import_name": "roboto"
}
]
Required Properties
Import Name (import_name
)
Specify the import name of the SCSS module that defines the font or font family or the URL to import a web font. This setting is mandatory for each defined font.
The value must be a string that either:
- Matches the name of an SCSS module in the
assets/fonts
folder. For example, to add the module inassets/fonts/_spectral.scss
, specifyspectral
. This value is case sensitive. - Is the URL to a webfont that you can import. For example, to add the Montserrat Google font, this value would
be
https://fonts.googleapis.com/css2?family=Montserrat&display=swap
.
Weight (weight
)
Specify the weight of the font’s SCSS module. Weighted SCSS modules are loaded from lowest to highest weight. Any font with a weight is loaded before unweighted modules.