Skip to content
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

Merged
merged 5 commits into from
Sep 30, 2020
Merged

Conversation

hbharding
Copy link
Contributor

@hbharding hbharding commented Sep 24, 2020

Summary

This PR fixes an unintended (i think?) consequence of reducing $euiFontSize to 14px which caused EuiTitle to use line-heights that increment in units of 7px (42, 35, 28, 21). I think we should keep EuiTitle line-heights as they are in the base theme so that they increment in units of 8px (48, 40, 32, 24).

Digging in

image

Since our lineHeightFromBaseline function references $euiFontSize and divides it by 2, changing the font size variable caused our baseline to increment in units of 7px (14 / 2 = 7) for EuiTitle.

image

EuiTitle is the only component that uses the lineHeightFromBaseline function. Because EuiTitle is used in so many places, this 7px increment throws a lot of components off of our imaginary grid. This can cause elements to align in weird ways, for example:

image

It also feels strange that the medium scale for EuiText h1 uses a 48px line height, whereas the large size for EuiTitle uses a 42px line height:

See screenshot

Screen Shot 2020-09-24 at 6 42 21 PM

What do you think?

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs
  • Added documentation
  • Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4079/

Copy link
Contributor

@cchaos cchaos left a 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!

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4079/

@cchaos cchaos force-pushed the amst/fix-title-lineheight branch from c292195 to 72818ab Compare September 30, 2020 14:16
@cchaos
Copy link
Contributor

cchaos commented Sep 30, 2020

Jenkins, test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4079/

@cchaos
Copy link
Contributor

cchaos commented Sep 30, 2020

Ugh, flakey flakey,
Jenkins, test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4079/

@cchaos cchaos merged commit 5270286 into elastic:master Sep 30, 2020
kshitij86 added a commit to kshitij86/eui that referenced this pull request Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants