MCPcopy Create free account
hub / github.com/microsoft/SandDance / _loadFonts

Function _loadFonts

docs/app/js/sanddance-app.js:26978–26993  ·  view source on GitHub ↗

* Loads font variables into a JSON object. * @param theme - The theme object

(theme)

Source from the content-addressed store, hash-verified

26976 * Loads font variables into a JSON object.
26977 * @param theme - The theme object
26978 */ function _loadFonts(theme) {
26979 var lines = {};
26980 for(var _i = 0, _a = Object.keys(theme.fonts); _i < _a.length; _i++){
26981 var fontName = _a[_i];
26982 var font = theme.fonts[fontName];
26983 for(var _b = 0, _c = Object.keys(font); _b < _c.length; _b++){
26984 var propName = _c[_b];
26985 var name_1 = fontName + propName.charAt(0).toUpperCase() + propName.slice(1);
26986 var value = font[propName];
26987 if (propName === "fontSize" && typeof value === "number") // if it's a number, convert it to px by default like our theming system does
26988 value = value + "px";
26989 lines[name_1] = value;
26990 }
26991 }
26992 return lines;
26993}
26994
26995},{"tslib":"01Tx1","@uifabric/utilities":"uTCgd","@microsoft/load-themed-styles":"4fkg1","@fluentui/theme/lib/createTheme":"ahsvz","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"4fkg1":[function(require,module,exports) {
26996var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers 1

loadThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected