[wp-trac] [WordPress Trac] #54953: Custom css variables in theme.json have different keys in 5.9

WordPress Trac noreply at wordpress.org
Thu Jan 27 14:20:06 UTC 2022


#54953: Custom css variables in theme.json have different keys in 5.9
--------------------------+-----------------------------
 Reporter:  walbo         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.9
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Noticed that custom css variables generated by `theme.json` can have
 different output in WP5.9 compared to how they were in 5.8. Seems like 5.9
 adds an extra `-` when numbers are included in the key.

 {{{
 {
   "settings": {
     "custom": {
       "m16": "1rem"
     }
   }
 }
 }}}

 The example above will in 5.8 create a variable called: `--wp--custom--
 m16` but in 5.9 it will be `--wp--custom--m-16`.

 I'm not sure if the change was a bug fix or unintended change. We have a
 plugin that allows themes to change som style using custom variables and
 this bug makes it hard to support both 5.8 and 5.9

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


More information about the wp-trac mailing list