seothemes / core-custom-colors
Add color settings to the Customizer through configuration
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/seothemes/core-custom-colors
Requires
- d2/core: ^0.1.0
- seothemes/core-utilities: dev-master
This package is auto-updated.
Last update: 2025-09-26 15:59:11 UTC
README
Add color settings to the Customizer with CSS output.
Installation
This component should be installed using Composer, with the command composer require seothemes/core-custom-colors.
Usage
Within your config file (typically found at config/defaults.php), use the CustomColors as an array key to add a list color settings to add to the Customizer.
For example:
use SEOThemes\Core\CustomColors; $custom_colors = [ 'background' => [ 'default' => '#ffffff', 'output' => [ [ 'elements' => [ '.site-container', ], 'properties' => [ 'background-color' => '%s', ], ], ], ], ]; return [ CustomColors::class => $custom_colors, ];
The above will add a new Background Color setting to the Colors section of the Customizer. It will also output the following CSS on the front-end of the site:
.site-container{background-color:#fff}
Load the component
Components should be loaded in your theme functions.php file, using the Theme::setup static method. Code should run on the after_setup_theme hook (or genesis_setup if you use Genesis Framework).
add_action( 'after_setup_theme', function() { $config = include_once __DIR__ . '/config/defaults.php'; D2\Core\Theme::setup( $config ); } );