getFontsHtml( )


Gets an HTML element containing CSS code to load fonts.

Use getFontsHtml() to get an HTML element containing the CSS code that loads 1 or more fonts. Use getFontsHtml() when embedding a custom element in a Wix site where the page's stylesheet fonts are inaccessible, such as when using a shadow root or an internal iframe.

Method Declaration
Copy
Method Parameters
fontsArray<string>Required

List of fonts to be loaded, where each font is represented by a value of a font CSS property.


optionsgetFontsHtmlOptions

The options used when getting the HTML element.

Returns
Return Type:Promise<string>
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?