@loadsmart/miranda-wc
Version:
Miranda Web Components component library
16 lines (15 loc) • 478 B
TypeScript
import type { CSSResult } from 'lit';
export declare const BASE_PIXELS = 16;
/**
* Convert the provided value from `px` to `rem` as lit's `CSSResult`.
*
* @example
* // Considering 1rem = 16px
* toRem(10); // returns '0.625rem'
* toRem('16px'); // returns '1rem'
*
* @param value value, in pixels, to convert.
* @param base value, in pixels, to be considered for 1rem.
*/
declare function toRem(value: number | string, base?: number): CSSResult;
export default toRem;