mdbassit / Coloris

A lightweight and elegant JavaScript color picker. Written in vanilla ES6, no dependencies. Accessible.
https://coloris.js.org/examples.html
MIT License
443 stars 58 forks source link

Add support for CSS custom properties (variables) #130

Closed kj-ivy closed 7 months ago

kj-ivy commented 8 months ago

Hello, first of all thanks for the great library!

My project required the color picker to support binding swatches to CSS custom properties. Loading custom properties into swatches was already functional, but the color value behind the property was not being parsed correctly when clicking on the swatch.

I have implemented support for custom properties in this fork https://github.com/kj-ivy/Coloris (See CSS Variable swatches in examples.html)

If you would be interested in supporting this feature officially I could open a pull request.

mdbassit commented 7 months ago

Hello, thank you for your kind words, and sorry for the late reply, it's been a busy couple of months.

Unfortunately I have no plans to support non CSS color values in the color picker, but feel free to modify your own version or even release it publicly if you so wish.