-
Notifications
You must be signed in to change notification settings - Fork 891
Connection: Component updates - replace Modal with Dialog #50735
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 2 commits
a1e6f0e
74281ef
31bda4e
ceb3273
59361bd
6afb0cc
115d1be
ee3650f
75ad660
2496e6f
3cf90c0
f9c973e
02967e4
045bf6a
aef8c19
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 |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: patch | ||
| Type: changed | ||
|
|
||
| Connection UI: migrate the disconnect, manage-connection and owner-disconnect modals from the @wordpress/components Modal to the @wordpress/ui Dialog. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,55 @@ | ||
| @use "@automattic/jetpack-base-styles/style"; | ||
|
|
||
| .jp-connection__disconnect-dialog { | ||
| --viewport-inset: 3rem; | ||
|
|
||
| display: flex; | ||
| flex-direction: column; | ||
| padding: 0; | ||
| overflow-y: auto; | ||
|
|
||
| h1 { | ||
| margin-top: 0; | ||
| --_gcd-heading-font-size: var(--font-title-small); | ||
| --_gcd-heading-font-weight: 600; | ||
| --_gcd-heading-margin: 0 0 0.67em; | ||
|
Comment on lines
+12
to
+14
Member
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. These attributes were meant to protect any CSS reset or other Are the style overrieds (here and elsewhere in this file) to the core component really needed? Ideally we would just use the components as-is. Worth checking with Jetpack design team if that would work! Long term these styles become pain to maintain since they're assuming the internal DOM structure doesn't change, and there aren't any other conflicting styles introduced in component later on.
Member
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'm looking into creating a lint rule to avoid using the internal gcd tokens: WordPress/gutenberg#80952 |
||
|
|
||
| margin: 0 0 0.67em; | ||
| line-height: 1.2; | ||
| font-size: var(--font-title-small); | ||
| font-weight: 600; | ||
| } | ||
|
|
||
| h2 { | ||
| --_gcd-heading-font-size: var(--font-title-small); | ||
| --_gcd-heading-font-weight: 400; | ||
|
|
||
| margin: 0; | ||
| line-height: 1.2; | ||
| font-size: var(--font-title-small); | ||
| font-weight: 400; | ||
| } | ||
|
|
||
| p { | ||
| --_gcd-p-font-size: var(--font-body); | ||
|
|
||
| margin-top: 0; | ||
| font-size: var(--font-body); | ||
| } | ||
|
|
||
| // `Text`'s own stylesheet sets `margin: 0` (layered), which for a `<p>` | ||
| // falls back to that default anyway, but for a bare `Text` (renders as a | ||
| // `<span>`, e.g. `OwnerDisconnectDialog`'s copy) leaves no gap before the | ||
| // next element, since a `<span>` has no UA margin of its own to restore. | ||
| // Same story for `line-height`: wp-admin's global `common.css` sets a bare | ||
| // `p { line-height: 1.5 }` that the raw `<p>` steps pick up for free, but a | ||
| // `<span>` never matches that selector, so it's restored explicitly here. | ||
| &__large-text, | ||
| p.jp-connection__disconnect-dialog__large-text { | ||
| --_gcd-p-font-size: 1.25rem; | ||
|
|
||
| margin: 0 0 1em; | ||
| font-size: 1.25rem; | ||
| line-height: 1.5; | ||
| } | ||
|
|
||
| &__link, | ||
|
|
@@ -54,25 +80,6 @@ | |
| border-radius: 4px; | ||
| } | ||
|
|
||
| .components-modal { | ||
|
|
||
| &__content { | ||
| padding: 0; | ||
| display: flex; | ||
| flex-direction: column; | ||
| flex-grow: 1; | ||
| margin: 0; | ||
|
|
||
| &::before { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| &__header { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| // The help message grows to fill the row; the button pair keeps its natural | ||
| // width beside it and wraps below once the row runs out of room. The | ||
| // flex-basis biases toward wrapping early, while `min-width: 0` lets the | ||
|
|
@@ -115,6 +122,23 @@ | |
| background: var(--jp-red) !important; | ||
| } | ||
|
|
||
| // Moved here from the owner dialog's stylesheet, which no longer renders | ||
| // these buttons — `DisconnectActionFooter` supplies its own footer actions. | ||
| // The @wordpress/ui Button emits no `.components-button` class, so the | ||
| // shared reset that wp-admin would otherwise apply is restored on the | ||
| // class itself. | ||
|
coder-karen marked this conversation as resolved.
|
||
| &__btn-dismiss, | ||
| &__btn-disconnect { | ||
| border: 0; | ||
| border-radius: 4px; | ||
| color: var(--wp-components-color-accent-inverted, #fff); | ||
| font-size: var(--font-body-small); | ||
| height: 40px; | ||
| text-decoration: none; | ||
| text-shadow: none; | ||
| white-space: nowrap; | ||
| } | ||
|
Comment on lines
+127
to
+142
Member
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. Similar to above question, could we simply use the button component as-is without overriding its styles entirely? Otherwise, there's little point in using a shared component in the first place. |
||
|
|
||
| &__btn-back-to-wp { | ||
| background: var(--jp-black) !important; | ||
| } | ||
|
|
@@ -181,8 +205,7 @@ | |
|
|
||
| @media (min-width: 600px) { | ||
|
|
||
| .jp-connection__disconnect-dialog, | ||
| .jp-connection__disconnect-dialog.components-modal__frame { | ||
| .jp-connection__disconnect-dialog { | ||
| width: 100%; | ||
| max-width: calc(100% - 32px); | ||
| } | ||
|
|
@@ -202,8 +225,7 @@ | |
|
|
||
| @media (min-width: 960px) { | ||
|
|
||
| .jp-connection__disconnect-dialog, | ||
| .jp-connection__disconnect-dialog.components-modal__frame { | ||
| .jp-connection__disconnect-dialog { | ||
| width: 1200px; | ||
| height: 900px; | ||
| display: flex; | ||
|
|
@@ -213,11 +235,15 @@ | |
| .jp-connection__disconnect-dialog { | ||
|
|
||
| h1 { | ||
| --_gcd-heading-font-size: var(--font-title-large); | ||
|
|
||
| font-size: var(--font-title-large); | ||
| } | ||
|
|
||
| &__large-text, | ||
| p.jp-connection__disconnect-dialog__large-text { | ||
| --_gcd-p-font-size: 1.5rem; | ||
|
|
||
| font-size: 1.5rem; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.