<?php
// File Security Check
if ( !defined( 'ABSPATH' ) ) {
    exit;
}
function roonix_theme_options_style() {
    $options = roonix_WSH()->option();

    //
    // Enqueueing StyleSheet file
    //
    wp_enqueue_style( 'roonix-theme-custom-style', get_template_directory_uri() . '/assets/css/custom-style.css' );
    $css_output = '';
    $roonix_primary_color = $options->get('roonix_primary_color');
    $roonix_body_color = $options->get('roonix_body_color');
    // var_dump($roonix_primary_color);
    // Body Color
    if(!empty($roonix_body_color)){
        $css_output .= '
        :root {
                --color-five: '.esc_attr($roonix_body_color).' !important;
            }
        ';
    }
    //Theme Primary Color
    if(!empty($roonix_primary_color)){
        $css_output .= '
        :root {
                --main-color: '.esc_attr($roonix_primary_color).' !important;
            }
        ';
    }
    wp_add_inline_style( 'roonix-theme-custom-style', $css_output );
}
add_action( 'wp_enqueue_scripts', 'roonix_theme_options_style' );