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

WordPress Trac noreply at wordpress.org
Wed May 13 19:29:42 UTC 2020


#49764: Twenty Eleven: 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 needs-refresh  |     Focuses:  ui
------------------------------------------+-----------------------------
Changes (by ianbelanger):

 * keywords:  good-first-bug needs-refresh needs-design-feedback => good-
     first-bug needs-refresh


Comment:

 Hi @dboy1988,

 I figured out why we are seeing different things. If I change the colors
 in the customizer, then the gradient options work just fine. However, if I
 start out with a brand new install, activate Twenty Eleven and do not
 change the colors in the customizer, then I see the issues I was talking
 about. Screenshot coming.

 The reason that both the first and second options are selected when
 selecting either of them, is that they are using exactly the same colors.
 See code below.

 {{{
 if(!empty(get_theme_mod('header_textcolor'))) {
         $themeColor['htc'] =
 twentyeleven_hexToRgb(str_split(get_theme_mod('header_textcolor')));
 } else {
         $themeColor['htc'] = twentyeleven_hexToRgb(str_split("000000"));
 }
 if(!empty(get_theme_mod('background_color'))) {
         $themeColor['bgc'] =
 twentyeleven_hexToRgb(str_split(get_theme_mod('background_color')));
 } else {
         $themeColor['bgc'] = twentyeleven_hexToRgb(str_split("000000"));
 }
 }}}

 Changing this: `$themeColor['bgc'] =
 twentyeleven_hexToRgb(str_split("000000"));` or this `$themeColor['htc'] =
 twentyeleven_hexToRgb(str_split("000000"));` to another color should fix
 this issue.

 Also, the gradient colors do show in the editor for the cover block and
 the button blocks, but it does not show when using a group block. Gradient
 support for group blocks will be added in the `5.5` release of WP, so we
 need to make sure that they are supported.

 If we get these things resolved, then this should be good to commit.
 Thanks!

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


More information about the wp-trac mailing list