-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Update the modal design #40781
Update the modal design #40781
Changes from 2 commits
aa4fecb
dc51eac
e1975a4
f87325a
8239136
d970066
7d3cb99
f280207
b7aa9d2
a746fe3
b3123dc
88c3f11
07a69b6
90db6fe
a4cc018
faeb082
756897b
2a9bec5
f59f3ca
9000b7c
8bfcc12
d1dbfba
b5c595c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,3 +1,9 @@ | ||||
body.modal-open { | ||||
#wpwrap { | ||||
filter: blur($grid-unit); | ||||
} | ||||
} | ||||
|
||||
// The scrim behind the modal window. | ||||
.components-modal__screen-overlay { | ||||
position: fixed; | ||||
|
@@ -20,7 +26,7 @@ | |||
width: 100%; | ||||
background: $white; | ||||
box-shadow: $shadow-modal; | ||||
border-radius: $radius-block-ui; | ||||
border-radius: $grid-unit; | ||||
overflow: hidden; | ||||
// Have the content element fill the vertical space yet not overflow. | ||||
display: flex; | ||||
|
@@ -63,8 +69,7 @@ | |||
// modal screen). | ||||
.components-modal__header { | ||||
box-sizing: border-box; | ||||
border-bottom: $border-width solid $gray-300; | ||||
padding: 0 $grid-unit-40; | ||||
padding: $grid-unit-20 $grid-unit-40 0; | ||||
display: flex; | ||||
flex-direction: row; | ||||
justify-content: space-between; | ||||
|
@@ -77,7 +82,7 @@ | |||
left: 0; | ||||
|
||||
.components-modal__header-heading { | ||||
font-size: 1rem; | ||||
font-size: 1.2rem; | ||||
font-weight: 600; | ||||
} | ||||
|
||||
|
@@ -113,7 +118,7 @@ | |||
// Modal contents. | ||||
.components-modal__content { | ||||
flex: 1; | ||||
margin-top: $header-height; | ||||
margin-top: $header-height + $grid-unit-20; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just flagging that this change may have introduced other layout regressions in places where it was assumed that the Modal's header was One such example is the block pattern inserter/explorer modal, where in my testing I spotted a regression caused by the fact that the sidebar was positioned at
In general, consumers of the While a short-term fix would be to update the line of code linked above to use the updated Modal's header height, I would argue that the best way to fix this specific regression in the block pattern inserter / explorer is to rewrite the modal's internal layout in a way that avoids absolute positioning and hardcoded margins/positions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I agree, the hardcoded height also causes issues where the modal title is long enough to wrap (uncommon but not impossible). Do you think we should do this as a part of this PR or elsewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably the best course of action is to:
|
||||
padding: 0 $grid-unit-40 $grid-unit-30; | ||||
overflow: auto; | ||||
|
||||
|
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.
It would be nice for things like this to be systematised, I'm aware of the experimental
Text
component, but it's not widely used. Perhaps there's a better way?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.
I'd personally love to see the
Text
andHeading
components user more often.I'm not sure if we need to first assess the type scale (and the rest of the styles), but otherwise I think we should slowly try to adopt them in other components, find out if they match our needs and make any necessary changes, before then rolling them out more widely across Gutenberg