[wp-trac] [WordPress Trac] #31006: Use classes instead of setting and directly animating background colors in JS

WordPress Trac noreply at wordpress.org
Wed Mar 25 22:31:27 UTC 2015


#31006: Use classes instead of setting and directly animating background colors in
JS
----------------------------+-----------------------------
 Reporter:  helen           |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Future Release
Component:  Administration  |     Version:
 Severity:  minor           |  Resolution:
 Keywords:  needs-patch     |     Focuses:  ui, javascript
----------------------------+-----------------------------
Changes (by helen):

 * keywords:  has-patch => needs-patch
 * type:  task (blessed) => enhancement
 * severity:  normal => minor
 * milestone:  4.2 => Future Release


Comment:

 I'm punting - this was exhausting to wrap my head around early on in the
 cycle, and it's near-impossible to get back into in the beta stage. It's
 not critical, but at least it is unblocked now. Anybody is free to pick
 this up if they want, highly suggest documenting possible approaches first
 before going all-in with a patch.

 Here are my collected thoughts distilled:

 * Use state-indicating classes for the colors and define the colors in
 CSS, e.g. "is-deleted" with a red color.
 * Use a data attribute to define what class is applied during the
 transition period.
 * Undecided whether we should handle color animation via jQuery UI
 (introducing that dependency in more places), or via CSS.
 * Very few plugins are using the hex values directly in the current data
 attribute, so don't worry about retaining that color (back compat). Do not
 change the current data attribute's format, though - if it contains a
 colon, continue to split it the current way. New implementations should
 then not have any colon-separated values in data attributes. Showing a
 different color for the transition state is not severe breakage, so I am
 not worried about dropping it.
 * Try to avoid doing a total refactor, as this is so old it's not
 realistic for it to last forever even if rewritten. But, if it requires
 it, then we should talk about that further so we don't bind ourselves into
 an API that we would kill off eventually.

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


More information about the wp-trac mailing list