#46432 closed defect (bug) (fixed)
Twenty Nineteen: Improve custom color behavior for InnerBlocks
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 5.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch has-screenshots |
Focuses: | Cc: |
Description
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:
- Assign the block itself a dark-colored background.
- Assign background and text colors to one of the interior paragraph blocks.
This will show up correctly in the editor:
In the frontend however, the text color will be incorrect:
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:
Attachments (1)
Change History (11)
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
6 years ago
#6
@
6 years ago
- Keywords commit removed
@andraganescu can you clarify what is ready for commit here? It appears that the necessary changes have already been committed and that no further action is needed.
#7
@
6 years ago
Yes you are right @desrosj i didn't pay attention to the fact that the diff was committed already. Nothing to do!
This looks good @kjellr. Gonna go ahead and commit this to trunk.