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

Refactor modal layout #42195

Open
jameskoster opened this issue Jul 6, 2022 · 3 comments
Open

Refactor modal layout #42195

jameskoster opened this issue Jul 6, 2022 · 3 comments
Labels
[Type] Enhancement A suggestion for improvement.

Comments

@jameskoster
Copy link
Contributor

The Modal component currently applies a fixed height to the header element.

height: $header-height + $grid-unit-20;

One drawback to this is that more complex modal layouts (such as the pattern explorer) absolutely position elements within which makes them fragile if that fixed height is ever updated in the underlying modal component.

Another issue is that the header is unable to grow in order to accommodate long titles.

Finally it means we have to apply additional padding to the top of the modal content so that it doesn't get obscured 'beneath' the header.

It would be better to avoid absolutely positioning the modal header if possible.

@jameskoster jameskoster added the [Type] Enhancement A suggestion for improvement. label Jul 6, 2022
@ciampo ciampo assigned mirka and ciampo and unassigned mirka and ciampo Jul 6, 2022
@ciampo
Copy link
Contributor

ciampo commented Jul 6, 2022

Thank you for opening this issue! Just wanted to add that we didn't necessarily discuss rewriting the Modal component's header — we mainly discussed refactoring specific modals that internally use the Modal component:

  • the block pattern inserter/explorer modal (details)
  • the block pattern setup modal (details)

The idea is that both modals listed above assume a hardcoded height for the Modals header — they should, instead, be refactored employing layouts and techniques that work regardless of the Modal's header height.

Separately from refactoring the code in these 2 modals, we could also look at the Modal component itself and see if we can make the header grow to accomodate longer text without causing breaking changes.

@annezazu
Copy link
Contributor

annezazu commented Apr 4, 2023

Can this be closed out with your PR updating the design and this related design issue? #39308

@jameskoster
Copy link
Contributor Author

I think this is separate. It's more about the underlying component while the referenced issue is just about the use of the component in specific use cases.

It may be that this one gets closed as/when we work on 39308, but it's a smaller part that could also be worked on in isolation before-hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants