• Hi,

    What is the right way of adding additional/custom color palettes to a Twenty Twenty-Five Child theme? I would like to see the additional palettes under appearance > styles > palettes and be able to easily toggle from one to the next.

    ALSO, what is the right way of deleting custom colors that I added to the default palette? I added a bunch of colors when I was testing TTF and now would like to clean things up.

    I’m sure this is documented somewhere only I was not able to find it. I read this article, but it didn’t answer the question. I could not find anything else.

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi
    These are features that are not part of this heme, they are features added by WordPress to all block themes.

    I would like to see the additional palettes under appearance > styles > palettes and be able to easily toggle from one to the next.

    I understand what you mean but that is not how the palettes are built in WordPress and not how child themes work. Like the documentation you linked explains, the color palette in the file in the child theme replaces the parent.

    If you have added colors to the palette with the interface, you have to use the interface to remove them. They are saved in the database of your site.
    If you have added colors to the file then you need to remove them from the file.

    Thread Starter ecabral

    (@ecabral)

    Yes, I did experiment with removing the CSS block with the unwanted colors from the file (/child-theme/theme.json), among other things, but as far as I remember once I swap palettes and then revert back all the colors show up again. That’s why I asked for help.

    Could you point me in the right direction, (e.g., provide a link to documentation on this topic that I may have missed)?

    Many thanks!

    Thread Starter ecabral

    (@ecabral)

    I found something! I’ll update this thread when done reading and, hopefully, fixing!

    Thread Starter ecabral

    (@ecabral)

    @poena – This is getting too painful… I’d really appreciate any guidance.

    As a reminder, I’m using a child of TTF. At some point, early on, possibly before I created the child theme, I added 5 custom colors to the default palette. These are same ones that I had been using on a project with a different block theme before I shifted to TTF. These 5 colors now appear alongside the default palette’s 8 colors. I would like to clean things up and trim those down to 8, but it appears it might have to be done in the DB. Editing the child theme.json makes no difference.

    Here’s other stuff that I tried (on my Child theme):

    • Edited all the 8 colors of the native/default palette so that my custom colors can then be used across the theme’s 5 styles. However, once I swap palettes (to any of the palettes that ship with TTF) and save, these customizations are gone. I’m back to the original 8 colors + the 5 custom colors I had added.
    • I created a brand new custom palette > Saved — this was gone too once I shifted to an existing palette and went back to the default one.

    Any clue what’s going on? I’m trying to figure out the right way to customize colors. According to this video I’m doing this the right way, but there’s something off here…

    Yes, if your child theme changes the color palette of theme.json, it changes the default color palette.
    As with all child theme changes, you override the parent theme file by replacing it with another file inside the child theme.
    If you want to override evening, you have to override the evening color palette, not the default.





    I created a brand new custom palette > Saved — this was gone too once I shifted to an existing palette and went back to the default one.

    Yes that is how WordPress works. You are selecting a different design. That design does not maintain the changes you made before you chose that design.

    Thread Starter ecabral

    (@ecabral)

    So, it appears that the only feasible option to update the color palette for my child theme is by editing the database directly. Nothing else works (neither updating the site editor nor the child’s theme.json).

    Could you kindly confirm?

    No.

    theme.json changes the default color palette.
    If you want to override evening, you have to override the evening color palette.
    If you want to change all style variations you have to change all style variations.
    These are separate files.

    If you change the color using the interface and then switch to a different style using the interface, your changes are not persistent.


Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.