[wp-trac] [WordPress Trac] #49711: Twenty Twenty: Add gradient background options that fit the theme color scheme

WordPress Trac noreply at wordpress.org
Fri May 1 15:36:25 UTC 2020


#49711: Twenty Twenty: Add gradient background options that fit the theme color
scheme
-------------------------------------------------+-------------------------
 Reporter:  ianbelanger                          |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Bundled Theme                        |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch needs-      |     Focuses:  ui, css
  design-feedback                                |
-------------------------------------------------+-------------------------

Comment (by samful):

 @Anlino Thanks for the expert feedback, I have followed your advice and
 have:

 * changed the {{{gradient}}} value in the {{{editor-gradient-presets}}} to
 use {{{twentytwenty_get_color_for_area()}}}

 and

 * added the css directly in the front-end section of
 {{{twentytwenty_get_customizer_css()}}}

 So now the gradients are based on the Customizer's values  (Accent,
 Primary, Secondary, Subtle Background, Background), rather than my own.

 I have 2 quick questions:
 1. I had to add a hex to rgb function into the theme, is the functions.php
 the best place for this?

 2. The Customizer **does not** update the gradients Live, you need to
 manually refresh the page, how would we get round this?

 I'll upload the patch and screenshots below, any advise and further
 suggestions would be great:

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


More information about the wp-trac mailing list