Some Friends send me the code... The Problem is more, that Metabox works in a other way. Im new in the metabox community und buyed the Dev licence couple days ago. My Questions to you was, how we can do this with Metabox. Thx
add_action( 'wp_enqueue_scripts', 'custom_css' );
/**
* Set custom CSS variables using values from ACF options page.
*/
function custom_css() {
$primary_color = get_field( 'primary_color', 'option' );
$secondary_color = get_field( 'secondary_color', 'option' );
$light_gray = get_field( 'light_gray', 'option' );
$main_dark = get_field( 'main_dark', 'option' );
$custom_css = "
:root {
--primary-color: {$primary_color};
--secondary-color: {$secondary_color};
--light-gray: {$light_gray};
--main-dark: {$main_dark};
}";
wp_add_inline_style( 'oxygen', $custom_css );
}