Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
398 stars 53 forks source link

Is it possible to limit the color palette per block? #260

Closed znikap closed 1 week ago

znikap commented 1 week ago

I was wondering if instead of taking all the colors from the theme.json (being generated with tailwind):

$supports = [
        'color' => [
            'background' => true,
            'text' => true,
            'gradient' => true,
       ],
];

you could define the colors you want to be available, so for example:

$supports = [
        'color' => [
            'background' => ['red-500', 'blue-500'],
            'text' => true
            'gradient' => true,
       ],
];

Is there any workaround to achieve that? So you could limit the colors per block?

Log1x commented 1 week ago

doesn't look like it. https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color