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

[EuiPagination] Remove Unneeded Styling Post EuiButtonEmpty Emotion Conversion #6893

Merged
merged 8 commits into from
Jun 29, 2023

Conversation

breehall
Copy link
Contributor

@breehall breehall commented Jun 29, 2023

Fixes #6890

Summary

When EuiPagination was converted to Emotion, a style hack was set and put in place in anticipation of the EuiButtonEmpty conversion. Now that the conversion is complete we no longer need the specificity hack.

With both styles in place, the numbers within EuiPagination aren't spaced properly.

QA

  1. Find the incorrect styling in production and confirm that the numbers are too close together within EuiPagination
  2. Compare staging and the PR preview before the EuiButtonEmpty conversion. Visually, they should be the same.

General checklist

  • Checked in Chrome, Safari, Edge, and Firefox
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

…uttonEmpty has been converted to Emotion and the hack is no longer needed.
@breehall breehall marked this pull request as ready for review June 29, 2023 14:58
@kibanamachine
Copy link

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

@breehall breehall requested a review from a team June 29, 2023 15:13
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
@cee-chen
Copy link
Contributor

Going to hang tight until staging finishes updating, and will approve after it looks good visually!

- uses the exact same styles as the default EuiPaginationButton now, so might as well reuse it

+ update snapshots
@kibanamachine
Copy link

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

cee-chen added 2 commits June 29, 2023 09:48
+ move `cursor: default` to top-level button, now that padding is set there instead of on `__content`
- `align-items` only applies to `display: flex` items, so it's not doing anything here. We want `align-self` for children of flex groups

- with the correct baseline alignment, the vertical padding is now unnecessary

- the `line-height` coming from the font-size mixin is causing a surprising amount of height offset and IMO, removing it makes the entire pagination component look more visually balanced. This appears to have been the case even pre-Emotion conversions, but I think this is a useful change to make while we're here
@@ -30,8 +30,7 @@ export const euiPaginationStyles = (euiThemeContext: UseEuiTheme) => {
euiPagination__compressedText: css`
display: inline-flex;
align-items: center;
/* Override EuiText line-height */
line-height: 1 !important; /* stylelint-disable-line declaration-no-important */
line-height: 1; /* Overrides EuiText line-height */
Copy link
Contributor

@cee-chen cee-chen Jun 29, 2023

Choose a reason for hiding this comment

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

I forgot to document this in the commit message, but I noticed this while doing DOM/devtools QA and figured I'd throw it in here while doing other CSS cleanup - the !important isn't needed anymore since EuiText is on Emotion and everything is flat.

@cee-chen
Copy link
Contributor

cee-chen commented Jun 29, 2023

@breehall this is an actual bugfix and needs a changelog, especially if we're doing a patch release. Otherwise we're releasing a new version without a changelog, which is a no-go (our release script literally won't let us do it)

Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

🚢

@kibanamachine
Copy link

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

cee-chen added 2 commits June 29, 2023 10:39
- without an `eui` prefix, we're not getting the benefits of our Emotion snapshot serializer

- there are no usages of `<EuiPaginationButton isPlaceholder>` anywhere in EUI or Kibana so we might as well completely remove the prop, and move its styles to the top level pagination component (where it's actually being used)

- top level pagination cleanup - rename `paginationStyles`->`styles` to match all other components + remove unnecessary array which is causing extra Emotion concatenation

- remove unnecessary `align-self` property from ellipsis styling - the `__list` parent is already setting it for all children
@kibanamachine
Copy link

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

@cee-chen
Copy link
Contributor

cee-chen commented Jun 29, 2023

@breehall FYI, technically the cleanup I pushed up is a breaking change (removes a prop) so the new release will be a major. In terms of impact, there's none to EUI or Kibana (we weren't using the prop anywhere), and likely very little elsewhere - most consumers are probably using EuiPagination only and not EuiPaginationButton. But it's the right move to mark the release as a major in any case, so just wanted to highlight that.

@breehall
Copy link
Contributor Author

@cee-chen Is this ok to merge? Just wanted to confirm before pressing the button :)

@cee-chen
Copy link
Contributor

Merge away!

@breehall breehall merged commit b0c98a6 into elastic:main Jun 29, 2023
Ikuni17 pushed a commit to elastic/kibana that referenced this pull request Jul 6, 2023
`eui@82.1.0` ⏩ `83.0.0`

⚠️ The biggest change in this PR by far is the `EuiButtonEmpty` Emotion
conversion, which changes the DOM structure of the button slightly as
well as several CSS classes around it.

EUI has attempted to convert any custom EuiButtonEmpty CSS overrides
where possible, but would super appreciate it if CODEOWNERS checked
their touched files. If anything other than a snapshot or test was
touched, please double check the display of your button(s) and confirm
everything still looks shipshape. Feel free to ping us for advice if
not.

---

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

**Bug fixes**

- Fixed `EuiPaginationButton` styling affected by `EuiButtonEmpty`'s
Emotion conversion ([#6893](elastic/eui#6893))

**Breaking changes**

- Removed `isPlaceholder` prop from `EuiPaginationButton`
([#6893](elastic/eui#6893))

## [`82.2.1`](https://github.com/elastic/eui/tree/v82.2.1)

- Updated supported Node engine versions to allow Node 16, 18 and >=20
([#6884](elastic/eui#6884))

## [`82.2.0`](https://github.com/elastic/eui/tree/v82.2.0)

- Updated EUI's SVG icons library to use latest SVGO v3 optimization
([#6843](elastic/eui#6843))
- Added success color `EuiNotificationBadge`
([#6864](elastic/eui#6864))
- Added `badgeColor` prop to `EuiFilterButton`
([#6864](elastic/eui#6864))
- Updated `EuiBadge` to use CSS-in-JS for named colors instead of inline
styles. Custom colors will still use inline styles.
([#6864](elastic/eui#6864))

**CSS-in-JS conversions**

- Converted `EuiButtonGroup` and `EuiButtonGroupButton` to Emotion
([#6841](elastic/eui#6841))
- Converted `EuiButtonIcon` to Emotion
([#6844](elastic/eui#6844))
- Converted `EuiButtonEmpty` to Emotion
([#6863](elastic/eui#6863))
- Converted `EuiCollapsibleNav` and `EuiCollapsibleNavGroup` to Emotion
([#6865](elastic/eui#6865))
- Removed Sass variables `$euiCollapsibleNavGroupLightBackgroundColor`,
`$euiCollapsibleNavGroupDarkBackgroundColor`, and
`$euiCollapsibleNavGroupDarkHighContrastColor`
([#6865](elastic/eui#6865))

---------

Co-authored-by: Cee Chen <constance.chen@elastic.co>
Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
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.

[EuiPagination] No space between page numbers
3 participants