Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override Palettes #53

Open
mike-sheppard opened this issue Sep 7, 2023 · 2 comments
Open

Override Palettes #53

mike-sheppard opened this issue Sep 7, 2023 · 2 comments

Comments

@mike-sheppard
Copy link
Contributor

mike-sheppard commented Sep 7, 2023

Hey @Log1x would it be possible to expose the Palette $colors via an ACF field setting so we can override them for specific fields?

We have a few elements on a new build where a custom palette is used for Taxonomy/Term accent colors but we don't want to add to the theme color palette that's used everywhere else.

I've been able to append colour using a hacky workaround add_theme_support('editor-color-palette', $tinted_palette); + check if on the correct admin URL, but would be great if we could do something like:

$tinted_palette = [
    [
        'name' => 'Magenta',
        'slug' => 'magenta',
        'color' => '#ff00ff',
    ], 
    ...
];

$terms_options->addField('term_accent_color', 'editor_palette', [
  'colors' => $tinted_palette,
]);
@Log1x
Copy link
Owner

Log1x commented Sep 7, 2023

This is pretty straight forward for the most part – the only annoying part is creating a decent UX for this when you're creating the field type in wp-admin and not programatically.

I'm a little swamped right now but I can try to look into it soon.

@mike-sheppard
Copy link
Contributor Author

mike-sheppard commented Sep 7, 2023

Cool, I'll try to pop a quick PR up that adds the option via PHP config, no idea how to nicely solve the Admin UI aspect either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants