kirki icon indicating copy to clipboard operation
kirki copied to clipboard

Multicolor not working with Preset

Open idlevibes95 opened this issue 3 years ago • 1 comments

Issue description:

I've tried every way I can think of, but Preset just doesn't work with Multicolor (works fine with the Color control). There's no example in the Kirki docs either. Is it possible at all for Multicolor to work with Preset?

Version used:

4.0.21

Using theme_mods or options?

theme_mods

PHP error messages that might be related


JS error messages that might be related


Code to reproduce the issue (config + field(s))


idlevibes95 avatar Aug 04 '22 13:08 idlevibes95

I'm fairly new to Kirki and figuring things out myself, but from looking at the JS file that applies presets, I'm going to say NO, it's not an option as-is right now.

/kirki/packages/kirki-framework/module-preset/src/script.js

Presets are applied to a specific controlValue, controlID combo.

Multicolors have multiple choices within a single controlValue, controlID combo, and you want the presets to apply to those multiple choices, not the controlValue, controlID combo.

I think a few JS code edits to that specific file could accomplish what you want, or you could accomplish it by following the example exactly as it is in the docs by setting up individual color fields (instead of a multicolor field) and applying the presets to those individual color fields: https://kirki.org/docs/arguments/preset/

codejp3 avatar Oct 03 '22 04:10 codejp3