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

File block: Center alignment option does not center block's text in editor #59968

Closed
sabernhardt opened this issue Mar 18, 2024 · 0 comments · Fixed by #59975
Closed

File block: Center alignment option does not center block's text in editor #59968

sabernhardt opened this issue Mar 18, 2024 · 0 comments · Fixed by #59975
Assignees
Labels
[Block] File Affects the File Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@sabernhardt
Copy link
Contributor

sabernhardt commented Mar 18, 2024

Description

Reported by pitamdey on Trac 58923, similar bug previously fixed in #8303

The File block Center alignment does not work in the editor with classic themes unless they have their own styles for centering blocks.

The front-end block styles include text-align: center, but editor.scss does not include a similar rule such as this:

.wp-block-file {
	.wp-block[data-align="center"] > & {
		text-align: center;
	}

Step-by-step reproduction instructions

  1. Activate Twenty Seventeen (or any earlier default theme).
  2. Add a new post.
  3. Insert a File block with the text link and download button.
  4. Choose the "Align center" option in the block toolbar.
  5. Save the post, and view/preview how it appears on the front end.

Screenshots, screen recording, code snippet

iframe editor, with Twenty Seventeen in WordPress 6.5-RC2:

block aligns to the left in the editor

front end:

block contents are centered on the front end

Environment info

  • WordPress 6.5-RC2, without Gutenberg
  • default themes from Twenty Ten to Twenty Seventeen, with and without iframe (Twenty Nineteen shows the same issue, but it also has its own bug with the download button)
  • desktop with Windows 10
  • Firefox 123.0.1

I also tested once with Gutenberg 17.9.0, using Twenty Seventeen and the iframe editor, to confirm it still happens with the plugin active.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@sabernhardt sabernhardt added the [Type] Bug An existing feature does not function as intended label Mar 18, 2024
@Mamaduka Mamaduka added the [Block] File Affects the File Block label Mar 19, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] File Affects the File Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants