Inwerpsel / use-theme-editor

A React theme editor
GNU General Public License v3.0
4 stars 0 forks source link

Better support for CSS keywords like `currentColor`, `initial`, ... #27

Open Inwerpsel opened 1 year ago

Inwerpsel commented 1 year ago

Some CSS keywords require special handling in order to know what value they represent.

For example, the UI currently displays currentColor the wrong way (hence bug label) (this gets excluded now), because it adds that value on the preview element, which doesn't receive the right color property for this to work. This could be corrected using the inspection result by traveling up the groups and locating the closest color property.

It's not immediately obvious how this is best handled generically for any CSS keywords. Perhaps this should wait for other changes that affect CSS handling, as otherwise the solution based on the current code would likely become obsolete in the near future.