acf-swatch
acf-swatch copied to clipboard
Add hide label option
Allows you to then use the label to generate a class in a template
@madebyreformat can you provide some more information in this PR about what it accomplishes? Screenshots welcomed.
Also ideally all new features are also added for 4.x version too.
Thanks
It allows you to toggle showing the label in the admin panel, this is so you can use the label within a theme to specify a class generally as a variable.
I looked at adding a third element to the options array but im not sure its possible after a quick scan of the ACF workings, looks like it's only expecting two items after splitting on the colon
eg. can't add #ff0000 : class-red : Red
I really like the plugin but don't want to add inline styles within the markup so wanted to toggle classes instead.
I tweaked the CSS for the swatch-toggle if it is selected just to make it a bit bigger too, see below:
