Skip to content
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

Fix off center post-publish button #17726

Merged
merged 10 commits into from
Nov 14, 2019
6 changes: 4 additions & 2 deletions packages/edit-post/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,18 @@
}

.edit-post-layout .editor-post-publish-panel__header-publish-button {
justify-content: center;

// Match the size of the Publish... button.
.components-button.is-large {
.components-button {
height: 33px;
line-height: 32px;
}

// Size the spacer flexibly to allow for different button lengths.
.editor-post-publish-panel__spacer {
display: inline-flex;
flex: 0 1 52px; // This number is approximative to keep the publish button at the same position when opening the panel
flex: 0 1 59px; // This number is approximative to keep the publish button at the same position when opening the panel
richtabor marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/components/post-publish-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export class PostPublishPanel extends Component {
) : (
<div className="editor-post-publish-panel__header-publish-button">
<PostPublishButton focusOnMount={ true } onSubmit={ this.onSubmit } forceIsDirty={ forceIsDirty } forceIsSaving={ forceIsSaving } />
<span className="editor-post-publish-panel__spacer"></span>
</div>
) }
<IconButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.editor-post-publish-panel__header {
background: $white;
padding-left: 16px;
padding-right: 8px;
height: $header-height;
border-bottom: $border-width solid $light-gray-500;
display: flex;
Expand Down