MCPcopy Create free account
hub / github.com/shoutem/ui / formatLineHeight

Function formatLineHeight

theme.js:122–137  ·  view source on GitHub ↗
(fontSize)

Source from the content-addressed store, hash-verified

120// This function is deprecated and replaced with calculateLineHeight.
121// It remains present here because of the backward compatibility.
122export function formatLineHeight(fontSize) {
123 // adds required padding to lineHeight to support
124 // different alphabets (Kanji, Greek, etc.)
125
126 // eslint-disable-next-line no-console
127 console.warn(
128 'formatLineHeight is deprecated and will be removed. Please use calculateLineHeight instead, it can simply be renamed as it takes the same argument and returns the same expected value, but more consistently across all fontSize.',
129 );
130
131 if (fontSize < 22) {
132 // minimum lineHeight for different alphabets is 25
133 return 25;
134 }
135
136 return fontSize + 3;
137}
138
139export function calculateLineHeight(fontSize) {
140 return fontSize * 1.5;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected