Inwerpsel / use-theme-editor

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

Support `calc` function #15

Open Inwerpsel opened 1 year ago

Inwerpsel commented 1 year ago

Since it uses a simple math syntax, it should be manageable to parse calc expressions and provide a UI for them.

Syntax:

https://developer.mozilla.org/en-US/docs/Web/CSS/calc#formal_syntax

To reflect the type constraints in the UI, types of each custom property would have to be known, which still has to be implemented. But it doesn't seem a blocker to get the rest to work.

Some ideas:

Inwerpsel commented 4 months ago

https://github.com/Inwerpsel/use-theme-editor/commit/ca72123113743f303b307ff6720283580d21b383