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

[EuiThemeProvider] Allow nested modify.breakpoint overrides #7862

Merged
merged 5 commits into from
Jul 1, 2024

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Jun 27, 2024

Summary

closes #7829

I originally started this work hoping it would be a quick fix/workaround solution to the broken docs example, but I quickly realized that EuiThemeProvider needed to be updated to handle modify={{ breakpoint }} overrides because it was currently not doing anything with that configuration.

We've also recently seen some dialogue in Slack with Fleet about needing to set custom breakpoints for certain screens/views/flyouts as opposed to entire plugins, so this work would strongly facilitate the ability to do that (currently difficult or not possible).

Note

Not addressed in this PR:
"I would still consider adding guidelines to flyout in our design system. it's important so when designers use 1200 version, they know what design principles to follow"
"[...] We document how to customize our breakpoints but not when to or when not to"

QA

General checklist

  • Browser QA
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
      - [ ] Checked in both light and dark modes
      - [ ] 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)
  • Designer checklist - N/A

- instead of `EuiProvider.modify.breakpoint`
@cee-chen cee-chen marked this pull request as ready for review June 27, 2024 18:27
@cee-chen cee-chen requested a review from a team as a code owner June 27, 2024 18:27
@cee-chen cee-chen force-pushed the docs/breakpoint-fix branch from dbaeb48 to 71cc628 Compare June 27, 2024 18:37
Copy link
Contributor

@mgadewoll mgadewoll left a comment

Choose a reason for hiding this comment

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

🚢 🐈‍⬛ The changes work as expected! LGTM 👍

packages/eui/src/services/theme/provider.tsx Outdated Show resolved Hide resolved
…ThemeProvider`

- in the previous logic, 2 resize listeners would instantiate for a top-level `<EuiProvider modify={{ breakpoint }} />` - this logic is simpler

+ rewrite tests for this PR to be their own describe block
@cee-chen cee-chen enabled auto-merge (squash) July 1, 2024 11:37
@kibanamachine
Copy link

Preview staging links for this PR:

@cee-chen cee-chen merged commit 3c0e0ae into elastic:main Jul 1, 2024
5 checks passed
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@cee-chen cee-chen deleted the docs/breakpoint-fix branch July 1, 2024 12:01
tkajtoch added a commit to elastic/kibana that referenced this pull request Jul 13, 2024
`v95.2.0`⏩`v95.3.0`

_[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_

---

## [`v95.3.0`](https://github.com/elastic/eui/releases/v95.3.0)

- Updated `EuiThemeProvider`s to allow modifying/setting custom
`breakpoint`s in nested usage (as opposed to only at the top
`EuiProvider` level) ([#7862](elastic/eui#7862))

**Bug fixes**

- Fixed a Chrome/Edge CSS `mask-image` bug that was affecting scroll
overflow shadow utilties
([#7855](elastic/eui#7855))

**CSS-in-JS conversions**

- Converted `EuiColorPicker` to Emotion; Removed `$euiColorPickerWidth`
([#7845](elastic/eui#7845))
- Converted `EuiColorPickerSwatch` to Emotion
([#7853](elastic/eui#7853))
- Converted `EuiColorPalettePicker` and `EuiColorPaletteDisplay` to
Emotion ([#7854](elastic/eui#7854))
  - Removed `$euiColorPaletteDisplaySizes`
  - Removed `@mixin euiColorPaletteInnerBorder`
- Removed `$euiColorPickerValueRange0`, `$euiColorPickerValueRange1`,
`$euiColorPickerSaturationRange0`, `$euiColorPickerSaturationRange1`,
and `$euiColorPickerIndicatorSize`
([#7859](elastic/eui#7859))

**Accessibility**

- Updated the `aria-label` attribute for the `EuiFilePicker` remove file
button ([#7860](elastic/eui#7860))

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
cee-chen pushed a commit to cee-chen/kibana that referenced this pull request Sep 12, 2024
`v95.2.0`⏩`v95.3.0`

_[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_

---

- Updated `EuiThemeProvider`s to allow modifying/setting custom
`breakpoint`s in nested usage (as opposed to only at the top
`EuiProvider` level) ([elastic#7862](elastic/eui#7862))

**Bug fixes**

- Fixed a Chrome/Edge CSS `mask-image` bug that was affecting scroll
overflow shadow utilties
([elastic#7855](elastic/eui#7855))

**CSS-in-JS conversions**

- Converted `EuiColorPicker` to Emotion; Removed `$euiColorPickerWidth`
([elastic#7845](elastic/eui#7845))
- Converted `EuiColorPickerSwatch` to Emotion
([elastic#7853](elastic/eui#7853))
- Converted `EuiColorPalettePicker` and `EuiColorPaletteDisplay` to
Emotion ([elastic#7854](elastic/eui#7854))
  - Removed `$euiColorPaletteDisplaySizes`
  - Removed `@mixin euiColorPaletteInnerBorder`
- Removed `$euiColorPickerValueRange0`, `$euiColorPickerValueRange1`,
`$euiColorPickerSaturationRange0`, `$euiColorPickerSaturationRange1`,
and `$euiColorPickerIndicatorSize`
([elastic#7859](elastic/eui#7859))

**Accessibility**

- Updated the `aria-label` attribute for the `EuiFilePicker` remove file
button ([elastic#7860](elastic/eui#7860))

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
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.

[Docs] EuiProvider custom breakpoints example no longer works
4 participants