Asset.font ViewHelper <vite:asset.font>
The <vite: ViewHelper allows to customize the preloading of
fonts referenced by the entry point of the <vite: ViewHelper, for
example fonts used in CSS files. It can only be used as a direct child
element of <vite:.
By default, only fonts in the woff2 format are preloaded, as all current browsers support it. Other formats are usually only fallbacks for legacy browsers.
See <vite:asset> for more examples.
Example: Disable preloading of fonts
<vite:asset entry="EXT:sitepackage/Resources/Private/JavaScript/Main.entry.js">
<vite:asset.font preload="{false}" />
</vite:asset>
Copied!
Arguments
The following arguments are available for the asset.font ViewHelper:
formats
-
- Type
- string
- Default
- 'woff2'
Comma-separated list of file extensions that should be preloaded (default: woff2). If empty, all fonts are preloaded.
preload
-
- Type
- bool
- Default
- true
Set to "false" if referenced fonts should not be preloaded.