From the course: WordPress Content Blocks: Working with Themes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add support for theme-specific colors

Add support for theme-specific colors - WordPress Tutorial

From the course: WordPress Content Blocks: Working with Themes

Start my 1-month free trial

Add support for theme-specific colors

- [Instructor] Some blocks, like the paragraph block you see here inside a column's block, allow for color customization of the text color and the background color. This is all controlled from the block properties panel on the right hand side under color settings. Out of the box, the block editor provides a selection of prepackaged colors, as well as a custom color option, that lets the user select any color they want. As a theme designer or developer, there's a good chance you have opinions about what colors work and don't work for your theme, and you may want to provide the theme user with a custom color palette or selection of specific colors to use instead of this random assortment you see here. The good news is your theme can be extended with custom color support, where you define your own colors and give them names. This is done by adding editor color palette theme support. Just like before, this is added in the theme setup function inside functions.php. I've added the code in…

Contents