[wp-trac] [WordPress Trac] #49931: Twenty Nineteen: Group color styles prevent custom colors

WordPress Trac noreply at wordpress.org
Tue Aug 27 19:37:48 UTC 2024


#49931: Twenty Nineteen: Group color styles prevent custom colors
-------------------------------------------------+-------------------------
 Reporter:  Joen                                 |       Owner:
                                                 |  sabernhardt
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Bundled Theme                        |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing 2nd-opinion  |     Focuses:  css
-------------------------------------------------+-------------------------

Comment (by sabernhardt):

 I uploaded a patch to show a different direction, but I do not expect that
 to be the final iteration (especially due to the links).

 1. Because the element with the background color class has the text color
 value, child elements could inherit that instead of re-declaring the same
 value.
 2. By grouping the headings and paragraph elements inside `:where()`, the
 background color ruleset would not override the text color classes added
 later in `style.css`. Then `:not(.has-text-color)` would be unnecessary.
 3. I removed the child combinator from `style.css`, which was not in the
 editor styles.
 4. The patch also inherits text colors for links unless the link element
 has a text color class or it is inside a Button or File block. Someone who
 has one of the theme's background colors on a Latest Posts or Query Loop
 block may find that other links should not inherit a text color either.
 5. In the editor, links would need a higher specificity to override
 `.editor-styles-wrapper .wp-block a` and `.editor-styles-wrapper .wp-block
 a:hover`.

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


More information about the wp-trac mailing list