-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add __next40pxDefaultSize for files in editor 4 #65140
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 | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -30,8 +30,7 @@ function TableOfContents( | |||||||||||||||||||||||||||||||||||||||||||||||||
contentClassName="table-of-contents__popover" | ||||||||||||||||||||||||||||||||||||||||||||||||||
renderToggle={ ( { isOpen, onToggle } ) => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Button | ||||||||||||||||||||||||||||||||||||||||||||||||||
// TODO: Switch to `true` (40px size) if possible | ||||||||||||||||||||||||||||||||||||||||||||||||||
__next40pxDefaultSize={ false } | ||||||||||||||||||||||||||||||||||||||||||||||||||
__next40pxDefaultSize | ||||||||||||||||||||||||||||||||||||||||||||||||||
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 looks good, thanks 👍 Here are some details in case that can be useful:
When used somewhere, the button is an icon button, and it looks good with the new size:
No style overrides. However, the popover has some overrides (not something we should address in this PR of course), cc @WordPress/gutenberg-components:
also cc @jorgefilipecosta should we deprecate 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. Hi @tyxla, yes I think we should deprecate it I will prepare a PR with the deprecation 👍 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. Thanks @jorgefilipecosta, feel free to ping me for a review! |
||||||||||||||||||||||||||||||||||||||||||||||||||
{ ...props } | ||||||||||||||||||||||||||||||||||||||||||||||||||
ref={ ref } | ||||||||||||||||||||||||||||||||||||||||||||||||||
onClick={ hasBlocks ? onToggle : undefined } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -40,8 +40,7 @@ export default function TextEditor( { autoFocus = false } ) { | |||||
<div className="editor-text-editor__toolbar"> | ||||||
<h2>{ __( 'Editing code' ) }</h2> | ||||||
<Button | ||||||
// TODO: Switch to `true` (40px size) if possible | ||||||
__next40pxDefaultSize={ false } | ||||||
__next40pxDefaultSize | ||||||
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. 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. The button is looking good 👍 However, the "Editing code" heading is still using the old height (reflected in the heading line height), so it needs to be updated to match the new button height. This should work: diff --git a/packages/editor/src/components/text-editor/style.scss b/packages/editor/src/components/text-editor/style.scss
index c8589fed6d..9b2748e08f 100644
--- a/packages/editor/src/components/text-editor/style.scss
+++ b/packages/editor/src/components/text-editor/style.scss
@@ -63,7 +63,7 @@
}
h2 {
- line-height: $button-size;
+ line-height: $button-size-next-default-40px;
margin: 0 auto 0 0;
font-size: $default-font-size;
color: $gray-900; Here's how it will look before and after this change:
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. Good one. I added a todo item in #46741 to clean up these variable usages. |
||||||
variant="tertiary" | ||||||
onClick={ () => switchEditorMode( 'visual' ) } | ||||||
shortcut={ shortcut } | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,8 +114,7 @@ const resetPost: Action< Post > = { | |
</Text> | ||
<HStack justify="right"> | ||
<Button | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
variant="tertiary" | ||
onClick={ closeModal } | ||
disabled={ isBusy } | ||
|
@@ -124,8 +123,7 @@ const resetPost: Action< Post > = { | |
{ __( 'Cancel' ) } | ||
</Button> | ||
<Button | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
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. |
||
variant="primary" | ||
onClick={ async () => { | ||
setIsBusy( true ); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,8 +67,7 @@ const trashPost: Action< PostWithPermissions > = { | |
</Text> | ||
<HStack justify="right"> | ||
<Button | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
variant="tertiary" | ||
onClick={ closeModal } | ||
disabled={ isBusy } | ||
|
@@ -77,8 +76,7 @@ const trashPost: Action< PostWithPermissions > = { | |
{ __( 'Cancel' ) } | ||
</Button> | ||
<Button | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
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. |
||
variant="primary" | ||
onClick={ async () => { | ||
setIsBusy( true ); | ||
|
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.