Compare commits

...

2 Commits

Author SHA1 Message Date
Eric Bailey c01c130b7b Add to existing 2024-02-09 11:56:19 -06:00
Eric Bailey 648462b5bd Round line height 2024-02-09 11:55:13 -06:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ export function leading<
>(textSize: Size, leading: Leading) {
const size = textSize?.fontSize || atoms.text_md.fontSize
const lineHeight = leading?.lineHeight || atoms.leading_normal.lineHeight
return size * lineHeight
return Math.round(size * lineHeight)
}
/**
@@ -32,7 +32,7 @@ function normalizeTextStyles(styles: TextStyle[]) {
if (s?.lineHeight) {
if (s.lineHeight <= 2) {
s.lineHeight = fontSize * s.lineHeight
s.lineHeight = Math.round(fontSize * s.lineHeight)
}
} else {
s.lineHeight = fontSize
+1 -1
View File
@@ -236,7 +236,7 @@ export function lh(
height: number,
): TextStyle {
return {
lineHeight: (theme.typography[type].fontSize || 16) * height,
lineHeight: Math.round((theme.typography[type].fontSize || 16) * height),
}
}