Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#53344 closed defect (bug) (fixed)

Add editor styles to the widgets block editor

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

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
5 years ago

  • Milestone Awaiting Review → 5.8

#2 @noisysocks
5 years ago

  • Milestone 5.8
  • Resolution → reported-upstream
  • Status new → closed

#3 @isabel_brison
5 years 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
5 years ago

  • Resolution reported-upstream
  • Status closed → 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.


5 years ago
#5

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

​noisysocks commented on ​PR #1369:


5 years ago
#6

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
5 years ago

#53388 was marked as a duplicate.

#8 @noisysocks
5 years ago

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

​tellthemachines commented on ​PR #1369:


5 years ago
#9

Test added!

#10 @desrosj
5 years ago

  • Milestone → 5.8

Reading a milestone for tracking.

#11 @audrasjb
5 years ago

#53454 was marked as a duplicate.

#12 @audrasjb
5 years 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 5 years ago by audrasjb (previous) (diff)

​noisysocks commented on ​PR #1369:


5 years ago
#13

Awesome. LGTM 👍

#14 @noisysocks
5 years ago

  • Keywords has-unit-tests commit added

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


5 years ago

#16 @desrosj
5 years 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.

​tellthemachines commented on ​PR #1369:


5 years ago
#17

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
5 years ago

  • Owner set to desrosj
  • Resolution → fixed
  • Status reopened → 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.

​desrosj commented on ​PR #1369:


5 years ago
#19

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.


5 years ago

Note: See TracTickets for help on using tickets.