Opened 6 weeks ago
Last modified 39 hours ago
#66188 accepted defect (bug)
Add vertical margin between Save Draft and Preview buttons in Classic Editor
| Reported by: | Emielb | Owned by: | joedolson |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Editor | Version: | 7.1.2 |
| Severity: | normal | Keywords: | admin-reskin has-patch |
| Cc: | Focuses: |
Description
When using a translated version of WordPress (e.g., fr_FR) with the Classic Editor, the translated strings for the "Save Draft" and "Preview" buttons are longer than in English. This causes the buttons to wrap onto two lines within the #minor-publishing-actions container.
Due to recent CSS changes applied to buttons, there is currently no vertical margin between them when they stack, causing a visual overlap.
Steps to reproduce
- Install and activate the Classic Editor plugin.
- Set the Site Language to French (fr_FR) to ensure the button text is long enough to wrap.
- Navigate to Articles → Ajouter un article.
- Observe the "Publier" metabox (specifically the "Enregistrer le brouillon" and "Prévisualiser" buttons).
- Notice that the buttons are stacked and touch each other without any vertical spacing.
Expected result
There should be a consistent vertical gap between the buttons when they are forced onto multiple lines.
Possible solution
A simple CSS adjustment could be added to handle the spacing when items wrap. For example, applying a bottom margin to the first button's container or utilizing flexbox gap on the parent #minor-publishing-actions:
#minor-publishing-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
justify-content: space-between;
}
/* Fallback/alternative */
#save-post {
margin-bottom: 8px;
}
Attachments (2)
Change History (11)
#2
@
6 weeks ago
Thanks for opening the ticket @Emielb and welcome to WordPress Core Trac.
I agree that we need at least some margin between the two buttons when they're stacked. I don't think we necessarily need to have them aligned on the left or so, though. The priority is to address the margin issue.
I was about to take ownership on this one as it was reported from someone in the French community after some useful discussion on our Slack team, but you beat me @joedolson :)
Well, let's fix this in 7.2.
#4
@
6 weeks ago
For any CSS change on this UI, reminder that there is a spinner there that should be taken into account. See screenshot.
#5
@
6 weeks ago
I reproduced the issue. Adding a bottom margin to Save Draft fixes the missing spacing when the buttons wrap.
Margin addition change is:
#save-post { float: left; margin-bottom: 8px; }
The tradeoff is that this also adds vertical space when both buttons fit on the same row.
Should we proceed with this simpler margin approach for now, or should we look into converting the entire container's layout to use flexbox so we can utilize the gap property instead?
This ticket was mentioned in PR #13807 on WordPress/wordpress-develop by @therssoftware.
6 weeks ago
#6
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/66188
Description
In the Classic Editor's "Publish" meta box (#minor-publishing-actions), the "Save Draft" and "Preview" buttons wrap onto two lines when button labels are translated into longer strings in non-English locales (e.g. French fr_FR or German de_DE), or on narrow sidebar viewports. Previously, when wrapping occurred, the buttons collided vertically with zero margin between them.
This PR updates #minor-publishing-actions to use flexbox layout, consistent with the existing modernization in #major-publishing-actions:
- Flexbox with wrapping and gap: Sets
#minor-publishing-actionstodisplay: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;. This ensures a clean 8px vertical separation whenever the buttons wrap to multiple lines. - Hide legacy clearfix: Sets
#minor-publishing-actions .clear { display: none; }as float clearing is no longer required with flex layout. - Centered spinner beside button: Sets
#save-actiontodisplay: flex; align-items: center;and removes the float on its child.spinner(float: none; margin-top: 0; margin-bottom: 0;), keeping the loading spinner vertically centered beside the button without float wrapping issues. - End alignment for Preview: Sets
#preview-actiontomargin-left: auto; text-align: right;(which Grunt RTL build automatically mirrors tomargin-right: auto; text-align: left;), preserving end-edge alignment both when side-by-side and when wrapped. - Clean up obsolete overrides: Removes
#save-action .spinnerfloat override inedit.css.
Testing Instructions
- In WordPress admin, install and activate the Classic Editor plugin (or test any post edit screen with the Classic Editor Publish meta box).
- Switch site language to French (
fr_FR) or German (de_DE), or inspect and artificially lengthen the "Save Draft" button text (e.g. "Enregistrer le brouillon"). - Narrow the Publish meta box sidebar width until the "Save Draft" and "Preview" buttons wrap onto separate lines.
- Verify that:
- There is an 8px vertical gap between the top button and bottom button (no collision).
- The Preview button aligns cleanly to the right edge (LTR) or left edge (RTL).
- Clicking "Save Draft" displays the spinner vertically centered beside the button.
- Test in RTL mode (e.g., Arabic or Hebrew) to confirm proper mirroring.
Props therssoftware.
---
AI Disclosure: In accordance with the WordPress AI policy, I disclose that generative AI (Google Antigravity) was used in drafting the CSS changes and testing across LTR/RTL locales, and all changes were manually reviewed and verified.
#7
@
6 weeks ago
I have opened a GitHub PR to resolve this using Flexbox: https://github.com/WordPress/wordpress-develop/pull/YOUR_PR_NUMBER
Instead of adding a permanent margin-bottom, this modernizes #minor-publishing-actions with display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;:
- Avoids the tradeoff mentioned in comment:5—when both buttons fit on a single row, no extra bottom spacing is added. Spacing only applies when wrapped.
- Centers
#save-actionand its.spinnervia flexbox, keeping the spinner vertically aligned without float issues. - Sets
#preview-actionwithmargin-left: auto; text-align: right;(and mirrors for RTL). - Hides the legacy
.clearelement and cleans up obsolete float overrides inedit.css.
Verified with Grunt RTL build across LTR and RTL locales.
*AI Disclosure: Prepared with generative AI assistance (Google Antigravity) and manually tested and verified.*
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)



Missing vertical margin between Save Draft and Preview buttons when stacked in fr_FR