Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#57833 closed defect (bug) (fixed)

Correctly merge custom CSS into global styles

Reported by: mamaduka's profile Mamaduka Owned by: gziolo's profile gziolo
Milestone: 6.2 Priority: normal
Severity: normal Version: 6.2
Component: Editor Keywords: gutenberg-merge has-patch commit
Focuses: Cc:

Description

Update the get_block_editor_settings function and merge custom CSS directly into the $global_styles array.

Why?

Styles added directly to the $editor_settings['styles'] will get overridden later into the function (See L#440). This method only works in the Gutenberg plugin, where we use a filter to inject additional styles.

Testing Instructions

  1. Using only 6.2 Beta 3, navigate to the Site Editor and add some custom CSS to the Heading block, for example, color: red
  2. Note the Heading blocks are now red in the Site Editor.
  3. Navigate to a page or post and add a Heading block. It is will not be red.
  4. Now activate Gutenberg 15.2, and the Headings will be red.

Original report: https://github.com/WordPress/gutenberg/issues/48466

Change History (8)

@Mamaduka commented on PR #4154:


2 years ago
#2

The test failure doesn't look related:

1) Tests_Admin_wpSiteHealth::test_object_cache_thresholds with data set #3 ('options_count', 100)
Failed asserting that false is true.

#3 @poena
2 years ago

I have followed the testing instructions and the PR solves the issue for me.

#4 @sakibmd
2 years ago

Thanks, @Mamaduka. PR looks good & it's working from my end.

@gziolo commented on PR #4154:


2 years ago
#5

The test passed after I re-run the failed job.

#6 @gziolo
2 years ago

  • Owner set to gziolo
  • Resolution set to fixed
  • Status changed from new to closed

In 55438:

Editor: Correctly merge custom CSS into global styles

Update the get_block_editor_settings function and merge custom CSS directly into the $global_styles array.

Fixes #57833.
Props Mamaduka, poena, sakibmd.

#8 @hellofromTonya
2 years ago

  • Keywords commit added
  • Version set to trunk
Note: See TracTickets for help on using tickets.