getFontsHtml( )


Gets an HTML element containing CSS code to load fonts.

Use the getFontsHtml() function to get an HTML element containing the CSS code that loads one or more fonts. Use this function 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>
Did this help?