@dcl/react-ecs
Version:
Decentraland ECS
12 lines (11 loc) • 594 B
TypeScript
import { ScaleContext, ScaleUnit } from '../types';
/**
* Scales a font size depending on a context's width/height
* @param {number} fontSize size of the font to scale
* @param {ScaleUnit} [scaleUnit=0.39] the scaling unit (uses "width" as unit if a number is supplied)
* @param {ScaleContext} [ctx=viewport] the context where to apply the scaling
* @returns {number} the fontSize scaled
* @see https://matthewjamestaylor.com/responsive-font-size#fluid
* @public
*/
export declare function scaleFontSize(fontSize: number, scaleUnit?: ScaleUnit, ctx?: ScaleContext | undefined): number;