zephjs icon indicating copy to clipboard operation
zephjs copied to clipboard

add font() definition method

Open arei opened this issue 5 years ago • 0 comments

Add the font() definition method.

This method is important to allow fonts to be bundled by the bundler and making ZephJS "compiled code" standalone as much as possible.

The font definition method takes three arguments:

  • fontName: The name of this font;
  • source: The filename (or inline content) of the font to be applied.
  • details: Object containing the @font-face details for this font.

Given these two attributes the font() method will download the font (if needed) and then create the font for the given custom element using the details specified.

Additionally, the bundler will be updated to inline the font() filename references. This means fonts thus declared will be inlined into the bundled code.

arei avatar Mar 25 '19 22:03 arei