-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Reduce modal style specificity so it can be overridden more easily #73739
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
Conversation
|
Size Change: +16 B (0%) Total Size: 2.58 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
andrewserong
left a comment
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.
Reducing specificity works for me!
It's a tiny bit unfortunate that we need to use margin-bottom (and the additional rules) for the full screen variant as I can imagine it could catch folks out who are updating or clearing out the padding within the modal. However, a better longer-term solution for that kind of use-case would be add a padding or hasPadding option to Modal itself, rather than consumers needing to worry about the internals of Modal.
All of which is to say: this fix sounds good to me!
t-hamano
left a comment
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.
LGTM!
While this isn't a blocker, I felt it was a bit aggressive to force the modal content into a flex layout.
Originally, the Font Library had a 32px padding at the bottom:
To restore this padding, we need to remove a flex layout from the modal content:
c27c818b419662a0640bff784d997806.mp4
I haven't found a good solution yet, but if we keep the current implementation, we may need to add a dev note to clarify that the content will be flex-layout in full-screen modals.
There's a whole discussion in the initial PR about the approach 😅 I'm not too strongly for or against it, as long as it works. Let's get this fix in for now and then perhaps discuss alternatives further? |
What?
Fixes vertical scroll issue reported in #73715 by slightly reducing the specificity of the styles added to the fullscreen modal in #73150.
Testing Instructions
npm run storybook:devand check the datapicker with modal story. The footer should still be sticky