-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
TextControl: remove margin overrides and add new opt-in prop (pt 1/2) #47157
Changes from all commits
11c3fe5
45b9f13
c4e9f40
62fe52c
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 |
---|---|---|
|
@@ -49,10 +49,7 @@ | |
.edit-post-template-top-area__popover { | ||
.components-popover__content { | ||
min-width: 280px; | ||
|
||
> div { | ||
padding: 0; | ||
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. This wasn't affecting the popover so it appeared to be broken (shared screenshots in testing steps). 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. Nice catch! Unrelated to this PR, but just to note some clean ways to resolve these common
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. Thank you for sharing! |
||
} | ||
padding: 0; | ||
} | ||
|
||
.edit-site-template-details__group { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,10 @@ import { useState } from '@wordpress/element'; | |
import { __ } from '@wordpress/i18n'; | ||
import { | ||
Button, | ||
Flex, | ||
FlexItem, | ||
Modal, | ||
TextControl, | ||
__experimentalHStack as HStack, | ||
__experimentalVStack as VStack, | ||
} from '@wordpress/components'; | ||
|
||
/** | ||
|
@@ -60,27 +60,22 @@ function AddCustomGenericTemplateModal( { | |
> | ||
{ isCreatingTemplate && <TemplateActionsLoadingScreen /> } | ||
<form onSubmit={ onCreateTemplate }> | ||
<Flex align="flex-start" gap={ 8 }> | ||
<FlexItem> | ||
<TextControl | ||
label={ __( 'Name' ) } | ||
value={ title } | ||
onChange={ setTitle } | ||
placeholder={ defaultTitle } | ||
disabled={ isBusy } | ||
help={ __( | ||
'Describe the template, e.g. "Post with sidebar".' | ||
) } | ||
/> | ||
</FlexItem> | ||
</Flex> | ||
|
||
<Flex | ||
className="edit-site-custom-generic-template__modal-actions" | ||
justify="flex-end" | ||
expanded={ false } | ||
> | ||
<FlexItem> | ||
<VStack spacing={ 6 }> | ||
<TextControl | ||
__nextHasNoMarginBottom | ||
label={ __( 'Name' ) } | ||
value={ title } | ||
onChange={ setTitle } | ||
placeholder={ defaultTitle } | ||
disabled={ isBusy } | ||
help={ __( | ||
'Describe the template, e.g. "Post with sidebar".' | ||
) } | ||
/> | ||
<HStack | ||
className="edit-site-custom-generic-template__modal-actions" | ||
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. Would it be better to remove the margin-top on 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. Yes, definitely! Nice catch. :) |
||
justify="right" | ||
> | ||
<Button | ||
variant="tertiary" | ||
onClick={ () => { | ||
|
@@ -89,8 +84,6 @@ function AddCustomGenericTemplateModal( { | |
> | ||
{ __( 'Cancel' ) } | ||
</Button> | ||
</FlexItem> | ||
<FlexItem> | ||
<Button | ||
variant="primary" | ||
type="submit" | ||
|
@@ -99,8 +92,8 @@ function AddCustomGenericTemplateModal( { | |
> | ||
{ __( 'Create' ) } | ||
</Button> | ||
</FlexItem> | ||
</Flex> | ||
</HStack> | ||
</VStack> | ||
</form> | ||
</Modal> | ||
); | ||
|
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.
To note, there is an additional margin override, but it appears to be coming from
ToolsPanel
:gutenberg/packages/components/src/tools-panel/styles.ts
Line 120 in fae9da1