[wp-trac] [WordPress Trac] #38993: Twenty Seventeen: Clearing header text color doesn't update color in preview

WordPress Trac noreply at wordpress.org
Fri Dec 2 19:47:53 UTC 2016


#38993: Twenty Seventeen: Clearing header text color doesn't update color in
preview
--------------------------------------------+--------------------
 Reporter:  ocean90                         |       Owner:
     Type:  defect (bug)                    |      Status:  new
 Priority:  low                             |   Milestone:  4.7
Component:  Bundled Theme                   |     Version:  trunk
 Severity:  normal                          |  Resolution:
 Keywords:  has-patch needs-testing commit  |     Focuses:
--------------------------------------------+--------------------

Comment (by davidakennedy):

 Replying to [comment:7 westonruter]:

 Good questions @westonruter!

 > * What about the situation when the header text color is ''added''? This
 patch removes the `#twentyseventeen-custom-header-styles` stylesheet
 entirely. When the header text is ''added'' shouldn't the `style` element
 be restored?

 That's covered here:

 {{{
 $( '.site-branding, .site-branding a, .site-description, .site-description
 a' ).css({
         color: to
 });
 }}}

 This code only comes into play if `to` is empty. It's easier to remove the
 styles than to figure out what the default text color should be, override
 it, etc. – the color is different based on whether a header image or video
 is in place.

 > * Likewise, when `is_customize_preview()`, the
 `twentyseventeen_header_style()` should output an empty `style` element
 when short-circuiting, even when there are no styles. This is so that the
 the style can be restored.

 The styles are added in the other parts of the code... this use case only
 covers the preview when you press the "Clear" button.

 > * The JS logic assumes that `default-text-color` is going to be an empty
 string. What if a child theme sets the default color?

 If Twenty Seventeen or a child theme where to add a default text color,
 everything should work fine – unless I'm missing something. I tested this
 by adding a default text color to Twenty Seventeen. The added logic never
 is run because the button now applies the "Default" color instead of
 clearing it.

 If I'm missing something, let me know.

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


More information about the wp-trac mailing list