From 41b7c078981942f298c67a8f110a93a27c01670d Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Fri, 9 Jul 2021 16:58:40 -0700 Subject: [PATCH 1/2] Only provide a default lineHeight when the fontSize is default --- src/components/Text.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Text.js b/src/components/Text.js index f2c1c62b7d78..696fd817c7ef 100644 --- a/src/components/Text.js +++ b/src/components/Text.js @@ -54,12 +54,15 @@ const Text = React.forwardRef(({ const componentStyle = { color, fontSize, - lineHeight: 20, textAlign, fontFamily: fontFamily[family], ...mergedStyles, }; + if (fontSize === variables.fontSizeNormal) { + componentStyle.lineHeight = 20; + } + return ( // eslint-disable-next-line react/jsx-props-no-spreading {children} From 993be4650fe80ac8f8955ff2c3d1b861aed9bf0a Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Fri, 9 Jul 2021 17:36:26 -0700 Subject: [PATCH 2/2] Use componentStyle fontSize, not prop --- src/components/Text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Text.js b/src/components/Text.js index 696fd817c7ef..16f0836da089 100644 --- a/src/components/Text.js +++ b/src/components/Text.js @@ -59,7 +59,7 @@ const Text = React.forwardRef(({ ...mergedStyles, }; - if (fontSize === variables.fontSizeNormal) { + if (componentStyle.fontSize === variables.fontSizeNormal) { componentStyle.lineHeight = 20; }