UNPKG

@codedoc/core

Version:

Create beautiful modern documentation websites.

35 lines 2.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Fonts = void 0; function Fonts(options, renderer) { if (!options) options = {}; if (!options.text) options.text = { name: 'Hind', url: 'https://fonts.googleapis.com/css?family=Hind:400,700&display=swap', }; if (!options.text.fallback) options.text.fallback = 'sans-serif'; if (!options.code) options.code = { name: 'Source Code Pro', url: 'https://fonts.googleapis.com/css?family=Source+Code+Pro:300,400&display=swap', }; if (!options.code.fallback) options.code.fallback = "'Courier New', Courier, monospace"; if (!options.icon) options.icon = { name: 'Material Icons', url: 'https://fonts.googleapis.com/icon?family=Material+Icons%7CMaterial+Icons+Outlined&display=swap' }; if (!options.icon.outline) options.icon.outline = options.icon.name + ' Outlined'; return renderer.create("fragment", null, renderer.create("link", { href: options.text.url, rel: "stylesheet" }), renderer.create("link", { href: options.code.url, rel: "stylesheet" }), renderer.create("link", { href: options.icon.url, rel: "stylesheet" }), renderer.create("style", null, "\n body, input, button {\n font-family: '" + options.text.name + "', " + options.text.fallback + ";\n }\n\n code, .hljs {\n font-family: '" + options.code.name + "', " + options.code.fallback + ";\n }\n\n .icon-font {\n font-family: '" + options.icon.name + "';\n font-weight: normal;\n font-style: normal;\n font-size: 24px; /* Preferred icon size */\n display: inline-block;\n line-height: 1;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: normal;\n white-space: nowrap;\n direction: ltr;\n \n /* Support for all WebKit browsers. */\n -webkit-font-smoothing: antialiased;\n /* Support for Safari and Chrome. */\n text-rendering: optimizeLegibility;\n \n /* Support for Firefox. */\n -moz-osx-font-smoothing: grayscale;\n \n /* Support for IE. */\n font-feature-settings: 'liga';\n }\n\n .icon-font.outline {\n font-family: '" + options.icon.outline + "';\n }\n ")); } exports.Fonts = Fonts; //# sourceMappingURL=fonts.js.map