[wp-trac] [WordPress Trac] #56497: Categories (List) block center alignment is not working with dropdown in editor (was: Twenty Eleven: Categories block center alignment is not reflecting on editor side)

WordPress Trac noreply at wordpress.org
Fri Sep 2 23:03:09 UTC 2022


#56497: Categories (List) block center alignment is not working with dropdown in
editor
---------------------------+------------------------------
 Reporter:  multidots1896  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  assigned
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Editor         |     Version:  6.0.1
 Severity:  normal         |  Resolution:
 Keywords:  close          |     Focuses:  css
---------------------------+------------------------------
Changes (by sabernhardt):

 * keywords:   => close
 * focuses:   => css


Old description:

> Categories block center alignment setting is not reflecting on editor
> side.
>
> 1: Activate the Twenty Eleven Theme
> 2: Add Categories Block
> 3: Change the alignment
>
> Here is Screen
> Recording:[https://share.cleanshot.com/CDO3nlFrsNj3r6TpLJH5]

New description:

 Categories block center alignment setting is not reflecting on editor
 side.

 1. Activate the Twenty Eleven Theme
 2. Add Categories Block (or "Categories List" block if Gutenberg plugin is
 activated)
 3. Select the "Display as dropdown" option in the sidebar
 4. Change the alignment to center

 Here is Screen
 Recording:[https://share.cleanshot.com/CDO3nlFrsNj3r6TpLJH5]

--

Comment:

 Thanks for the report!

 I do not recommend trying to fix the block alignment in individual themes'
 editor styles. Twenty Twenty-One is the only bundled theme I found that
 centers the Categories List block's dropdown in the editor, so this would
 be better to [https://github.com/WordPress/gutenberg/issues/new/choose
 report on GitHub].

 Note: the plugin has renamed this block "Categories List" in GB39837.
 (This might confuse people who have been using the "Categories" block
 since WordPress 5.8, but that's a separate issue.)

 A new Trac ticket could address the front-end margin with the dropdown
 option of Archives and Categories List blocks. Twenty Ten, Twenty Eleven
 and Twenty Fourteen have a
 [https://core.trac.wordpress.org/browser/tags/6.0/src/wp-
 content/themes/twentyeleven/blocks.css#L294 left margin] for the list
 markup that pushes the dropdown (and its label) slightly off-center.
 Adding this worked for me in each of the blocks.css files:
 {{{
 .wp-block-archives-dropdown.aligncenter,
 .wp-block-categories-dropdown.aligncenter,
 .rtl .wp-block-archives-dropdown.aligncenter,
 .rtl .wp-block-categories-dropdown.aligncenter {
         margin-left: 0;
         margin-right: 0;
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56497#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list