[wp-trac] [WordPress Trac] #40940: Twenty Twelve uses invalid linear-gradient() syntax

WordPress Trac noreply at wordpress.org
Wed Jun 7 14:57:17 UTC 2017


#40940: Twenty Twelve uses invalid linear-gradient() syntax
---------------------------+-----------------------------
 Reporter:  vrubleg        |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Bundled Theme  |    Version:  4.7.5
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 Twenty Twelve theme uses such construction for gradients:
 {{{
         background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);
         background-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6);
         background-image: -webkit-linear-gradient(top, #f4f4f4, #e6e6e6);
         background-image: -o-linear-gradient(top, #f4f4f4, #e6e6e6);
         background-image: linear-gradient(top, #f4f4f4, #e6e6e6);
 }}}
 Notice this obsolete syntax:
 {{{
 linear-gradient(top, #f4f4f4, #e6e6e6)
 }}}
 And compare it to the specification:
 https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient

 It has to use "to" before the direction. So, it has to be:
 {{{
 linear-gradient(to bottom, #f4f4f4, #e6e6e6)
 }}}
 or like this:
 {{{
 linear-gradient(180deg, #f4f4f4, #e6e6e6)
 }}}
 It works now just because browsers parse this property from prefixed
 linear gradient, and prefixed linear gradient allows to omit "to", and it
 is actually parsed as "from". It will stop work when support of obsolete
 prefixed properties will be removed. And we have to replace all "top" to
 "to bottom" or to "180deg".

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40940>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list