-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix EuiTitle lineheight #4079
Fix EuiTitle lineheight #4079
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_4079/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think this will work. Thanks for catching this. I checked the renders and EuiTitle and EuiText (medium size) and the line-heights match.
👍 Don't forget a changelog!
src/themes/eui-amsterdam/global_styling/variables/_typography.scss
Outdated
Show resolved
Hide resolved
Preview documentation changes for this PR: https://eui.elastic.co/pr_4079/ |
c292195
to
72818ab
Compare
Jenkins, test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4079/ |
Ugh, flakey flakey, |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4079/ |
Summary
This PR fixes an unintended (i think?) consequence of reducing
$euiFontSize
to14px
which causedEuiTitle
to use line-heights that increment in units of7px
(42, 35, 28, 21). I think we should keepEuiTitle
line-heights as they are in the base theme so that they increment in units of8px
(48, 40, 32, 24).Digging in
Since our
lineHeightFromBaseline
function references$euiFontSize
and divides it by 2, changing the font size variable caused our baseline to increment in units of7px
(14 / 2 = 7) forEuiTitle
.EuiTitle
is the only component that uses thelineHeightFromBaseline
function. Because EuiTitle is used in so many places, this7px
increment throws a lot of components off of our imaginary grid. This can cause elements to align in weird ways, for example:It also feels strange that the medium scale for
EuiText
h1
uses a 48px line height, whereas the large size forEuiTitle
uses a 42px line height:See screenshot
What do you think?
Checklist
Checked in Chrome, Safari, Edge, and FirefoxProps have proper autodocsAdded documentationChecked Code Sandbox works for the any docs examplesAdded or updated jest testsChecked for breaking changes and labeled appropriatelyChecked for accessibility including keyboard-only and screenreader modes