-
Notifications
You must be signed in to change notification settings - Fork 0
Expose Addons Reference
Spatchy edited this page Feb 28, 2023
·
3 revisions
⯇Previous: Winside API Reference | Next: Bundling, Installation and Running⯈
Addons are a collection of special options that can be optionally exposed in a Winsert by passing specific strings in the exposeAddons array in the Winsert's manifest.json. These options are intended to give a Winsert access to certain additional data in various ways: both through the window.Winside.addons object and by injecting CSS and JavaScript directly at runtime.
Purpose: This option exposes assets used by Winside itself so they are available for use in Winserts. This includes the logo vector and the Questrial font.
- Exposed on
window.Winside.addons.winsideAssets:-
.logoSvg: <svg xml string> | A string containing the XML data for an SVG vector image of the Winside logo. The string has been modified to replace inline styles with CSS class names for use with the injected companion stylesheet.- Usage:
// Inserts logo into parent element with the ID #container: const container = document.getElementById("container") container.innerHTML = window.Winside.addons.winsideAssets.logoSvg
- Usage:
-
.questrialFont: <binary string> | A string containing the raw binary data of the Questrial font, for use with the FontFace API- Usage:
const questrial = new FontFace( "Questrial", window.Winside.addons.winsideAssets.questrialFont ) document.fonts.add(questrial) // 'Questrial' can now be used in the document via CSS etc.
p { font-family: 'Questrial', sans-serif }
- Usage:
-
- auto-injected content:
- SVG logo companion CSS:
- Usage: Passive - applies automatically when using the logo svg
- SVG logo companion CSS:
⯇Previous: Winside API Reference | Next: Bundling, Installation and Running⯈