mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-31 12:03:58 -05:00
d3c144e5e9
* color library * fixes * wip * wip * wip * wip * working * improvements * changeset * changeset * changeset & cleaning * changeset & cleaning * improvements * fixes * rebase
12 lines
359 B
TypeScript
12 lines
359 B
TypeScript
export const translateLineHeight = (
|
|
segment: Pick<StyledTextSegment, 'lineHeight' | 'fontSize'>
|
|
): string => {
|
|
switch (segment.lineHeight.unit) {
|
|
case 'PIXELS':
|
|
return (segment.lineHeight.value / segment.fontSize).toString();
|
|
case 'PERCENT':
|
|
return (segment.lineHeight.value / 100).toString();
|
|
default:
|
|
return '1.2';
|
|
}
|
|
};
|