-
Notifications
You must be signed in to change notification settings - Fork 2k
Language Switcher: Replace custom Dialog component with the core Modal. #103503
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
Changes from all commits
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,37 +1,50 @@ | ||
@import "@wordpress/base-styles/breakpoints"; | ||
@import "@wordpress/base-styles/mixins"; | ||
|
||
.language-picker__modal-search { | ||
position: relative; | ||
width: 250px; | ||
} | ||
|
||
.language-picker__dialog { | ||
&.dialog.card { | ||
width: 90%; | ||
height: 80%; | ||
justify-content: space-between; | ||
} | ||
.language-picker__overlay { | ||
justify-content: center; | ||
} | ||
|
||
.dialog__content { | ||
flex: 1 1 auto; | ||
.language-picker__modal { | ||
max-width:80%; | ||
min-width: 80%; | ||
@media (max-width: $break-mobile) { | ||
max-width: 90%; | ||
min-width: 90%; | ||
} | ||
.components-modal__header { | ||
display:none; | ||
} | ||
|
||
.dialog__action-buttons { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
justify-content: space-between; | ||
position: relative; | ||
margin: 0; | ||
padding: 0; | ||
// prevent buttons div from covering language options | ||
margin-top: 1.5rem; | ||
|
||
.components-button { | ||
margin-left: 1rem; | ||
.components-modal__content { | ||
padding: 24px 0 0 0; | ||
margin-top: 24px; | ||
display:flex; | ||
/* Targeting the content div, we can't alter the HTML of the modal itself */ | ||
>div:nth-child(2) { | ||
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. In general, I think the more we can avoid referencing internal structures of external components, the better. These may change, even the core class names may change e.g. In this case, it looks we can achieve the same effect by wrapping the content we pass to the modal and target that instead, e.g.
Targeting But pls confirm. I only briefly tested. We can drill into the need to even reference |
||
height: 100%; | ||
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. Does Sorry for my questions. CSS is not trivial to maintain. |
||
display: flex; | ||
flex-direction: column; | ||
} | ||
} | ||
|
||
.language-picker-component .language-picker-component__heading { | ||
margin: 6px 0 24px; | ||
.components-flex-block { | ||
flex:none; | ||
} | ||
.language-picker-component { | ||
overflow-y: auto; | ||
padding:0 24px; | ||
.language-picker-component__heading { | ||
margin: 6px 0 24px; | ||
} | ||
.components-flex { | ||
flex:initial; | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
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.
What are we targeting with this? Can we add a comment, or is there another way to be more explicit/clear? 🤔
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've added a comment, unfortunately, there's no easy way to add a class to the Modal HTML structure.
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.
Heya. Replied below - #103503 (comment)
Let me know if you'll be confirming that, otherwise happy to explore further myself. :)
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.
Yep, I'm currently addressing the reported issues.
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.
Sounds good. Happy to review any additional changes.