UNPKG

@stories-js/core

Version:

Stories web components to build stories

26 lines 623 B
/*! * (C) StoriesJS https://storiesjs.org - GPL-2.0 License */ export function browserSupportsCssZoom() { try { return ( // eslint-disable-next-line @typescript-eslint/no-explicit-any document.implementation.createHTMLDocument('').body.style.zoom !== undefined); } catch (error) { return false; } } export function computeZoomStyle(zoom) { return { zoom: zoom.toPrecision(2), }; } export function computeTransformStyle(height, zoom) { return { height: (height + 50).toFixed(), transformOrigin: 'top left', transform: `scale(${zoom})`, }; } //# sourceMappingURL=utils.js.map