[wp-trac] [WordPress Trac] #61287: Twenty Sixteen: Code block is not reflecting selected background color in frontend (was: Twenty Sixteen : Code Block Background color is not reflecting in frontend)

WordPress Trac noreply at wordpress.org
Mon Jul 1 18:02:02 UTC 2024


#61287: Twenty Sixteen: Code block is not reflecting selected background color in
frontend
-----------------------------------------------------+---------------------
 Reporter:  pitamdey                                 |       Owner:  (none)
     Type:  defect (bug)                             |      Status:  new
 Priority:  normal                                   |   Milestone:  6.7
Component:  Bundled Theme                            |     Version:
 Severity:  normal                                   |  Resolution:
 Keywords:  has-patch 2nd-opinion changes-requested  |     Focuses:  css
-----------------------------------------------------+---------------------
Changes (by sabernhardt):

 * keywords:  has-test-report has-patch => has-patch 2nd-opinion changes-
     requested
 * milestone:  Future Release => 6.7


Comment:

 > We seem to have two patches here with slightly different approaches.

 A hybrid of both might be a better direction than either of those two.

 61287.3.patch
 - I focused on the Code block, and the patch only removes the background
 color when that specific block has a background.
 - The theme's (block) editor styles would include the same rule, for
 consistency and for backward compatibility. That technically is not
 necessary starting with WordPress 6.1, when the Code block removed any
 background from the `code` element with `background: none` (GB43599).

 61287.4.patch
 - In addition to the Code block, any other block that can add a `has-
 background` class to a `pre` element—with a `code` element inside it—might
 benefit from the second approach.
 - Other blocks with a custom background would still have the gray `code`
 element background within the editor, however.
 - I would prefer `transparent` instead of `inherit` for background color
 (though both seem to work).
 - The property-value pair needs to be on its own line to meet
 [https://developer.wordpress.org/coding-standards/wordpress-coding-
 standards/css/#structure CSS Coding Standards] (and for consistency with
 the rest of the stylesheet).

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


More information about the wp-trac mailing list