new-data-services / statamic-bard-color-picker

Text color picker with swatches for Bard fields
https://statamic.com/addons/new-data-services/bard-color-picker
8 stars 0 forks source link

Tailwind CSS config values #6

Open heidkaemper opened 5 months ago

heidkaemper commented 5 months ago

It would be a nice improvement if we could reference the Tailwind CSS color config directly, not only HEX colors.

Example:

/*
|--------------------------------------------------------------------------
| Pickr swatches (recommended colors)
|--------------------------------------------------------------------------
*/
'recommended' => [
    'colors.blue.500',
    'colors.customcolor.200',
],
clementmas commented 3 months ago

It looks like it's already possible to enter CSS variables so this issue will be solved with Tailwind CSS v4.

'swatches' => [
    'var(--color-blue-500)',
],

CSS variables is the way to go.

heidkaemper commented 3 months ago

Thanks for your input @clementmas!

And CSS variables are probably the right approach. However, this would not work out of the box in the Statamic CP if you have defined custom colors in your Tailwind CSS Config.

So there's still a bit of work to be done.