@primer/primitives
Version:
Typography, spacing, and color primitives for Primer design system
16 lines (15 loc) • 797 B
TypeScript
import type { Transform, TransformedToken } from 'style-dictionary/types';
/**
* takes a value and returns it if its a px string if it is a float and the token has a fontSize value in extensions['org.primer.data']
* @param value
* @returns string
*/
export declare const convertFloatToPixel: (token: TransformedToken, unitless?: boolean) => any;
/**
* @description converts a float value to a pixel value based on the provided fontSize on the tokersn extension
* @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
* @matcher matches all tokens of $type `isNumber`
* @transformer returns a pixel string
*/
export declare const floatToPixel: Transform;
export declare const floatToPixelUnitless: Transform;