WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#53344 closed defect (bug) (fixed)

Add editor styles to the widgets block editor

Reported by: isabel_brison Owned by: desrosj
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: has-patch has-unit-tests commit
Focuses: Cc:

Description

Initially reported here: https://github.com/WordPress/gutenberg/issues/32449

(style changes are visible in the front end, but not previewable in the editor)

The settings passed to the widgets editor initialization function don't include theme styles. In the post editor, theme styles are being added to the settings here: https://github.com/WordPress/wordpress-develop/blob/master/src/wp-admin/edit-form-blocks.php#L131-L132 so perhaps we should do the same for Widgets.

Change History (20)

#1 @noisysocks
4 months ago

  • Milestone changed from Awaiting Review to 5.8

#2 @noisysocks
4 months ago

  • Milestone 5.8 deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

#3 @isabel_brison
4 months ago

Closing this in favour of https://github.com/WordPress/gutenberg/issues/26163.

If we do go ahead with allowing theme styles in the Widgets editor, the change will have to be done in core, so we should probably close the Gutenberg ticket in favour of this one instead.

#4 @isabel_brison
4 months ago

  • Resolution reported-upstream deleted
  • Status changed from closed to reopened

Reopening this to try adding theme styles in the Widgets editor.

This ticket was mentioned in PR #1369 on WordPress/wordpress-develop by tellthemachines.


4 months ago

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/53344

Loads theme styles in the Widgets editor in the same way as they are loaded in the post editor. Will also require some CSS changes on the Gutenberg side, but basic functionality can already be tested in this PR by enabling Twenty Twenty One and checking that its styles are loaded in the Widgets editor.

#6 @prbot
4 months ago

noisysocks commented on PR #1369:

Oh, could you add a unit test for get_block_editor_theme_styles? You can use the the one we have for get_legacy_widget_block_editor_settings as inspiration.

#7 @noisysocks
4 months ago

#53388 was marked as a duplicate.

#8 @noisysocks
4 months ago

  • Summary changed from Changing block styles in the Widgets editor doesn't show changes in the editor to Add editor styles to the widgets block editor

#9 @prbot
4 months ago

tellthemachines commented on PR #1369:

Test added!

#10 @desrosj
4 months ago

  • Milestone set to 5.8

Reading a milestone for tracking.

#11 @audrasjb
4 months ago

#53454 was marked as a duplicate.

#12 @audrasjb
4 months ago

I tested the patch in TT1 and it fixes the default font-family issue I reported in #53454, which was a duplicate of this ticket :)

Last edited 4 months ago by audrasjb (previous) (diff)

#13 @prbot
4 months ago

noisysocks commented on PR #1369:

Awesome. LGTM 👍

#14 @noisysocks
4 months ago

  • Keywords has-unit-tests commit added

This ticket was mentioned in Slack in #core by isabelbrison. View the logs.


4 months ago

#16 @desrosj
4 months ago

I added some questions in a review on the PR. But overall it looks really good and tests well! There are some small styling adjustments that will need to be made in the default themes, but the widgets at least stylistically match the theme now.

#17 @prbot
4 months ago

tellthemachines commented on PR #1369:

Also, it looks like WordPress/gutenberg#32683 was merged. Does this have to land after the pacakge updates are committed to Core? Or can this be committed at any time now?

This can be committed any time! If the package updates aren't in yet we'll see some styling bugs, but no major breakage.

#18 @desrosj
4 months ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from reopened to closed

In 51200:

Widgets: Add editor styles to the widgets block editor.

This updates the widgets screen to load the editor styles in the same way as the post editor. This combined with the package updates in [51198] and [51199] ensures that the blocks added to sidebars more accurately reflect what will be displayed on the front end of the site.

Props isabel_brison, noisysocks, andraganescu, audrasjb, jorbin, caseymilne, desrosj.
Fixes #53344. See #53388.

#19 @prbot
4 months ago

desrosj commented on PR #1369:

Thanks everyone! Merged into Core in https://core.trac.wordpress.org/changeset/51200.

This ticket was mentioned in Slack in #core by desrosj. View the logs.


4 months ago

Note: See TracTickets for help on using tickets.