Plugin: Color Palette Field, custom classes

Hello everybody,

we recently had the case that a plugin had to be changed slightly to do what we imagine.

Sylvain (the plugin machine) has adapted one of his fields to our needs and eventually it may need one or the other, we find it very convenient.

What is the field doing?

The field will pick up the colors from the page settings and play them back anywhere. The special thing is that it does not save a color value but exactly what is predefined, in our case, the color is displayed, but a CSS class output. This can be especially useful when working with bootstrap. On hover there’s a tooltip which class is the output.

For native, we replaced all of our select fields which echo the Bootstrap color with this field. So everytime we change a color, we can see it in the panel but the output stays the same. So you never have to remind was Primary color red or secondary? Useful when non devs are working with Kirby sites and have trouble with CSS Classes.

Attached are 2 screenshots and the link to the branch on GitHub.

Sitesettings


Usecase