-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 missing padding from the page header to the main content #140706
Fix missing padding from the page header to the main content #140706
Conversation
…m-the-page-header-to-the-main-content-in-inventory
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
@jennypavlova Looking at the visual changes it works, but I don't think it's necessary to create custom styling, the padding should be part of the |
@formgeist Thank you for the feedback! The padding is part of the component but the custom styles are added with the page template update and they were overriding the padding so I just moved them to a separate class so the styles coming from the eui component (+ the padding) are now there. Maybe we can define the styles for the full height layout under a flag inside |
…m-the-page-header-to-the-main-content-in-inventory
Hey hey! This changeset looks fine, but I'll admit I'm a little confused how the Emotion CSS you converted to Sass is overriding padding. Are you saying that passing a |
@constancecchen The issue is that after using the emotion |
Hey hey! I'm testing this now on a CodeSandbox with latest EUI and can confirm this is indeed an issue with passing I'll leave it up to y'all as to preference, but that fix should theoretically negate the need for this Sass workaround if you want to wait for it. Totally up to you |
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.
Extracting the class seems a lot cleaner to me. I'd say go for it unless @elastic/observability-design recommends avoiding it for some reason.
I think it's totally fine to wait for this fix in EUI first 👍 The only thing I'd like to avoid is any possible inconsistencies it might provide across all our apps. |
@constancecchen Thank you for checking it! I still don't get why setting the emotion
Or the styles defined inside the content eui (under a class)
What do you think about this idea? |
Oh sorry, it's not strictly better - it's just that when I converted those 3 files/templates to the new Eui/KibanaPageTemplate, they were previously using TBH, I'm personally ambivalent either way as to whether you use Sass or Emotion; in general I'd say our architecture is trending towards CSS-in-JS over Sass (EUI will eventually be deprecating its usage of Sass and all our exported Sass variables), but I don't know if Kibana will be anytime soon. If you wanted to DRY this out but still use Emotion, what you could do instead is:
That way you don't repeat your styles but remain in the CSS-in-JS ecosystem. FYI, the fix for |
…m-the-page-header-to-the-main-content-in-inventory
@constancecchen Thank you for the good explanation! I agree let's use emotion then, no preference from my side either. I used your suggestion and pushed the changes. Once your PR (#140323) is merged we can fully test it 🙌 |
…m-the-page-header-to-the-main-content-in-inventory
…m-the-page-header-to-the-main-content-in-inventory
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
I merged the changes locally from the PR (#140323) and it looks good :) The styles are merged correctly now. |
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.
@jennypavlova Sounds good, feel free to merge
Fixes #140002
Summary
This PR fixes the issue with the missing padding on Inventory, Hosts, and Logs/Stream pages. The issue was introduced with #139524. Using the emotion
CSS
overrides the defined CSS of the content and the EUI content class is not added.So as a solution I added an extra class inside the
contentProps
and defined the styles inside the index.scss. That way the styles will be merged with the component styles and there won't be any override (also they are reused for all pages).@constancecchen I would like to hear your opinion as well as you may have better ideas as you are more familiar with the EUI components.