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

Update global EUI font size to use configurable theme units #7182

Merged
merged 9 commits into from
Oct 4, 2023

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Sep 12, 2023

Summary

closes #7143

This PR updates our global body/html font-size to use the configurable font.defaultUnits token (added in #7133).

This feature is a breaking change from how EUI has functioned in the past, but is a net accessibility boost, as switching to rem font sizing correctly allows EUI to respect the browser default font size configured by end users.

Screencaps

With default browser font size of 30px:

With default browser font size of 9px:

New docs callout:
callout

QA

General checklist

  • Browser QA
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)

@cee-chen cee-chen changed the title Global default font size unit Global EUI font size now uses configurable theme units Sep 12, 2023
@cee-chen cee-chen changed the title Global EUI font size now uses configurable theme units Update global EUI font size to use configurable theme units Sep 12, 2023
@cee-chen cee-chen requested a review from a team September 12, 2023 19:20
@cee-chen
Copy link
Member Author

@JasonStoltz What was the plan for messaging around this breaking change? Do we want to make it a prerelease or check with Kibana designers how this will affect end-users before merging it into main?

@cee-chen cee-chen marked this pull request as ready for review September 12, 2023 19:21
@github-actions
Copy link

github-actions bot commented Sep 12, 2023

This PR contains breaking changes. The opener of this pull request is asked to perform the following due diligence steps below, to assist EUI in our next Kibana upgrade:

  • If this PR contains prop/API changes: N/A
  • If this PR contains CSS changes:
    • Search through Kibana for the changed EUI selectors, e.g. .euiComponent (example search) (N/A)
    • In the PR description or in a PR comment, include a count or list with the number of custom CSS overrides in Kibana that will need to be updated (if that amount is "none", include that information as well) (NONE)
  • 🔍 Tip: When searching through Kibana, consider excluding **/target, **/*.snap, **/*.storyshot files to reduce noise and only look at source code usages
  • ⚠️ For extremely risky changes, the EUI team should potentially consider the following precautions:
    • Using a pre-release release candidate to test Kibana CI ahead of time
    • Using kibana-a-la-carte for manual QA, and to give other Kibana teams a staging server to quickly test against

Copy link
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had one wordsmith change for the accessibility callout box. I ran through the recommended QA, but will definitely spend more time tomorrow clicking through pages vs. production.

src-docs/src/views/theme/typography/_typography_js.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I took a pass through views side by side with production in light and dark mode. Didn't observe any differences. 🎉

This will be a big win for accessibility!

@cee-chen
Copy link
Member Author

cee-chen commented Oct 3, 2023

The 2 weeks TTL has passed with multiple Elastic teams contacted - no one has expressed major concerns with this change, so I'll be moving forward with it here shortly.

@cee-chen cee-chen enabled auto-merge (squash) October 3, 2023 20:40
@kibanamachine
Copy link

Preview staging links for this PR:

@cee-chen cee-chen merged commit 7f14f18 into elastic:main Oct 4, 2023
7 checks passed
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@cee-chen cee-chen deleted the global-default-font-size-unit branch October 4, 2023 18:55
1Copenut pushed a commit to elastic/kibana that referenced this pull request Oct 11, 2023
`v88.5.4`⏩`v89.0.0`

---

## [`89.0.0`](https://github.com/elastic/eui/tree/v89.0.0)

- Added new `pushAnimation` prop to push `EuiFlyout`s, which enables a
slide in animation ([#7239](elastic/eui#7239))
- Updated `EuiComboBox` to use `EuiInputPopover` under the hood
([#7246](elastic/eui#7246))
- Added `inputPopoverProps` to `EuiComboBox`, which allows customizing
the underlying popover
([#7246](elastic/eui#7246))
- Added a new beta `EuiTextBlockTruncate` component for multi-line
truncation ([#7250](elastic/eui#7250))
- Updated `EuiBasicTable` and `EuiInMemoryTable` to support multi-line
truncation. This can be set via `truncateText.lines` in the `columns`
prop. ([#7254](elastic/eui#7254))

**Bug fixes**

- Fixed `EuiFlexGroup` and `EuiFlexGrid`'s `m` gutter size
([#7251](elastic/eui#7251))
- Fixed focus trap rerender issues in `EuiFlyout` with memoization
([#7259](elastic/eui#7259))
- Fixed a visual bug with `EuiContextMenu`'s animation between panels
([#7268](elastic/eui#7268))

**Breaking changes**

- EUI's global body font-size now respects the `font.defaultUnits`
token. This means that the global font size will use the `rem` unit by
default, instead of `px`.
([#7182](elastic/eui#7182))
- Removed exported `accessibleClickKeys`, `comboBoxKeys`, and
`cascadingMenuKeys` services. Use the generic `keys` service instead
([#7256](elastic/eui#7256))
- Removed `EuiColorStops` due to low usage
([#7262](elastic/eui#7262))
- Removed `EuiSuggest`. We recommend using `EuiSelectable` or
`EuiComboBox` instead
([#7263](elastic/eui#7263))
- Removed `euiHeaderAffordForFixed` Sass mixin, and `$euiHeaderHeight`
and `$euiHeaderHeightCompensation` Sass variables. Use the CSS variable
`--var(euiFixedHeadersOffset, 0)` instead.
([#7264](elastic/eui#7264))

**Accessibility**

- When using `rem` or `em` font units, EUI now respects, instead of
ignoring, browser default font sizes set by end users.
([#7182](elastic/eui#7182))
dej611 pushed a commit to dej611/kibana that referenced this pull request Oct 17, 2023
`v88.5.4`⏩`v89.0.0`

---

## [`89.0.0`](https://github.com/elastic/eui/tree/v89.0.0)

- Added new `pushAnimation` prop to push `EuiFlyout`s, which enables a
slide in animation ([elastic#7239](elastic/eui#7239))
- Updated `EuiComboBox` to use `EuiInputPopover` under the hood
([elastic#7246](elastic/eui#7246))
- Added `inputPopoverProps` to `EuiComboBox`, which allows customizing
the underlying popover
([elastic#7246](elastic/eui#7246))
- Added a new beta `EuiTextBlockTruncate` component for multi-line
truncation ([elastic#7250](elastic/eui#7250))
- Updated `EuiBasicTable` and `EuiInMemoryTable` to support multi-line
truncation. This can be set via `truncateText.lines` in the `columns`
prop. ([elastic#7254](elastic/eui#7254))

**Bug fixes**

- Fixed `EuiFlexGroup` and `EuiFlexGrid`'s `m` gutter size
([elastic#7251](elastic/eui#7251))
- Fixed focus trap rerender issues in `EuiFlyout` with memoization
([elastic#7259](elastic/eui#7259))
- Fixed a visual bug with `EuiContextMenu`'s animation between panels
([elastic#7268](elastic/eui#7268))

**Breaking changes**

- EUI's global body font-size now respects the `font.defaultUnits`
token. This means that the global font size will use the `rem` unit by
default, instead of `px`.
([elastic#7182](elastic/eui#7182))
- Removed exported `accessibleClickKeys`, `comboBoxKeys`, and
`cascadingMenuKeys` services. Use the generic `keys` service instead
([elastic#7256](elastic/eui#7256))
- Removed `EuiColorStops` due to low usage
([elastic#7262](elastic/eui#7262))
- Removed `EuiSuggest`. We recommend using `EuiSelectable` or
`EuiComboBox` instead
([elastic#7263](elastic/eui#7263))
- Removed `euiHeaderAffordForFixed` Sass mixin, and `$euiHeaderHeight`
and `$euiHeaderHeightCompensation` Sass variables. Use the CSS variable
`--var(euiFixedHeadersOffset, 0)` instead.
([elastic#7264](elastic/eui#7264))

**Accessibility**

- When using `rem` or `em` font units, EUI now respects, instead of
ignoring, browser default font sizes set by end users.
([elastic#7182](elastic/eui#7182))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[a11y] EUI does not respect user/browser default font sizes
4 participants