When using the ACF color picker with a dynamically loaded color palette from theme.json, everything works — but if you pass more than three colors, the color swatches break the layout in the admin UI. The swatches wrap poorly or appear misaligned, making the interface look cluttered and hard to use.
<script type="text/javascript">
(function ($) {
acf.add_filter('color_picker_args', function (args, field) {
args.hide = false;
args.palettes = <?php echo json_encode($colors); ?>;
return args;
});
})(jQuery);
</script>
💥 Example Screenshot:
