[wp-trac] [WordPress Trac] #46432: Twenty Nineteen: Improve custom color behavior for InnerBlocks

WordPress Trac noreply at wordpress.org
Wed Mar 6 18:16:07 UTC 2019


#46432: Twenty Nineteen: Improve custom color behavior for InnerBlocks
---------------------------+---------------------------------------
 Reporter:  kjellr         |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  5.2
Component:  Bundled Theme  |    Version:
 Severity:  normal         |   Keywords:  has-patch has-screenshots
  Focuses:                 |
---------------------------+---------------------------------------
 Like Gutenberg, Twenty Nineteen includes some default color rules to
 prevent unreadable text. For instance, if you choose to give a paragraph a
 dark gray background (from the theme's custom palette), the text will
 switch to be white by default.

 This works great for individual blocks, but it causes some interference
 with nested blocks. Currently, if a parent block has a custom background
 color assigned, its child blocks will inherit the parent's text colors —
 even if the child block has its own custom text color assigned to it.

 You can try this out by creating a Media + Text block:

 1. Assign the block itself a dark-colored background.
 2. Assign background and text colors to one of the interior paragraph
 blocks.

 This will show up correctly in the editor:

 [[Image(https://cldup.com/bBYNJuKuKg-2000x2000.png)]]

 In the frontend however, the text color will be incorrect:

 [[Image(https://cldup.com/XDHBkCxwUz-3000x3000.png)]]

 This is because the child block is inheriting the theme's "default" text
 color from the blue parent block.

 The included patch adjusts Twenty Nineteen's custom background color
 defaults to target direct children only. When applied, this example will
 show up correctly on the front end:

 [[Image(https://cldup.com/SL-tIArdQl-2000x2000.png)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46432>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list