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

WordPress Trac noreply at wordpress.org
Mon May 4 15:38:07 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):

 thanks @Anlino, no problem about "late" reply, I'm very grateful you
 taking the time for this, and it wasn't late ;)

 I have fixed the points you mentioned apart from the customiser issue, I
 will try and make it clear for you:

 * Strangely i didn't encounter the  "Gutenberg 8.0.0, blocks with the
 gradients set aren't displaying the gradient background" issue but i added
 an IF statement to account to fix this as it does seem logical.

 * After checking the {{{twentytwenty_get_elements_array}}} I can see this
 "{{{:root}}} selector", and have changed my code to target {{{:root .has-
 primary-to-accent-gradient-background}}}.

 * Added default CSS to style.css, style-rtl.css, editor-style-block.css
 and editor-style-block-rtl.css files. Code outputting the gradient styles
 in custom-css.php are now wrapped in conditionals, so they are only output
 if any of the colors used in each gradient differ from the default color.

 * {{{hex2rgb}}} function is now called {{{twentytwenty_hex2rgb}}} and
 close to the {{{twentytwenty_get_elements_array}}} function.

 * I've tried to follow existing file structure and naming, but if anyone
 can check it before the patch goes live then that would be ideal.

 * Regarding the Customizer I'm afraid i know less that you do  about this.
 I tried looking at what is going on and it seems like the javascript
 function   {{{twentyTwentyGenerateColorA11yPreviewStyles()}}} is
 generating a CSS file on the fly, but I am unsure how we can do what I did
 in PHP in javascript...

 * On another note, I've never seen a Customizer color reflected live in
 widgets or blocks on the fly before. I think this feature would be nice,
 but is it essential? If so, do you know anyone who can advise on this?

 Many thanks.

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


More information about the wp-trac mailing list