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
10 changes: 3 additions & 7 deletions packages/edit-post/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,13 @@
}

.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
}
}

.edit-post-toggle-publish-panel {
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
8 changes: 7 additions & 1 deletion packages/editor/src/components/post-publish-panel/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@

.editor-post-publish-panel__header {
background: $white;
padding-left: 16px;
padding-left: 8px;
padding-right: 8px;
height: $header-height;
border-bottom: $border-width solid $light-gray-500;
display: flex;
align-items: center;
align-content: space-between;

.components-icon-button {
position: absolute;
right: 8px;
}
}

.editor-post-publish-panel__header-publish-button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ exports[`PostPublishPanel should render the pre-publish panel if post status is
focusOnMount={true}
onSubmit={[Function]}
/>
<span
className="editor-post-publish-panel__spacer"
/>
</div>
<ForwardRef(IconButton)
aria-expanded={true}
Expand Down Expand Up @@ -123,9 +120,6 @@ exports[`PostPublishPanel should render the pre-publish panel if the post is not
focusOnMount={true}
onSubmit={[Function]}
/>
<span
className="editor-post-publish-panel__spacer"
/>
</div>
<ForwardRef(IconButton)
aria-expanded={true}
Expand Down Expand Up @@ -162,9 +156,6 @@ exports[`PostPublishPanel should render the spinner if the post is being saved 1
focusOnMount={true}
onSubmit={[Function]}
/>
<span
className="editor-post-publish-panel__spacer"
/>
</div>
<ForwardRef(IconButton)
aria-expanded={true}
Expand Down