<?php //phpcs:ignore (doc comment).
/**
 * Custom CSS Output based on Customizer settings.
 *
 * @return void
 */
function pixigo_customizer_css() {

	echo '<style>';

	// Global color.
	$primary_color = get_theme_mod( 'pixigo_theme_color' );
	if ( $primary_color ) {
		echo 'body { --color-primary: ' . sanitize_hex_color( $primary_color ) . ';}'; // WPCS: XSS OK.
	}

	echo '</style>';
}

add_action( 'wp_head', 'pixigo_customizer_css', 10 );
