File: /var/www/html/wpprotonperinggit/wp-content/themes/voiture/inc/custom-styles.php
<?php
if ( !function_exists ('voiture_custom_styles') ) {
function voiture_custom_styles() {
global $post;
ob_start();
?>
<?php if ( voiture_get_config('main_color') != "" ) {
$main_color = voiture_get_config('main_color');
} else {
$main_color = '#0A2357';
}
if ( voiture_get_config('second_color') != "" ) {
$second_color = voiture_get_config('second_color');
} else {
$second_color = '#F5C34B';
}
if ( voiture_get_config('main_hover_color') != "" ) {
$main_hover_color = voiture_get_config('main_hover_color');
} else {
$main_hover_color = '#071a40';
}
if ( voiture_get_config('second_hover_color') != "" ) {
$second_hover_color = voiture_get_config('second_hover_color');
} else {
$second_hover_color = '#0A2357';
}
if ( voiture_get_config('text_color') != "" ) {
$text_color = voiture_get_config('text_color');
} else {
$text_color = '#5F6973';
}
if ( voiture_get_config('link_color') != "" ) {
$link_color = voiture_get_config('link_color');
} else {
$link_color = '#1A3760';
}
if ( voiture_get_config('link_hover_color') != "" ) {
$link_hover_color = voiture_get_config('link_hover_color');
} else {
$link_hover_color = '#1947E2';
}
if ( voiture_get_config('heading_color') != "" ) {
$heading_color = voiture_get_config('heading_color');
} else {
$heading_color = '#1A3760';
}
$main_color_rgb = voiture_hex2rgb($main_color);
$second_color_rgb = voiture_hex2rgb($second_color);
// font
$main_font = voiture_get_config('main-font');
$main_font = !empty($main_font) ? json_decode($main_font, true) : array();
$main_font_family = !empty($main_font['fontfamily']) ? $main_font['fontfamily'] : 'Inter';
$main_font_weight = !empty($main_font['fontweight']) ? $main_font['fontweight'] : 400;
$main_font_size = !empty(voiture_get_config('main-font-size')) ? voiture_get_config('main-font-size').'px' : '13px';
$main_font_arr = explode(',', $main_font_family);
if ( count($main_font_arr) == 1 ) {
$main_font_family = "'".$main_font_family."'";
}
$heading_font = voiture_get_config('heading-font');
$heading_font = !empty($heading_font) ? json_decode($heading_font, true) : array();
$heading_font_family = !empty($heading_font['fontfamily']) ? $heading_font['fontfamily'] : 'Inter';
$heading_font_weight = !empty($heading_font['fontweight']) ? $heading_font['fontweight'] : 600;
$heading_font_arr = explode(',', $heading_font_family);
if ( count($heading_font_arr) == 1 ) {
$heading_font_family = "'".$heading_font_family."'";
}
?>
:root {
--voiture-theme-color: <?php echo trim($main_color); ?>;
--voiture-second-color: <?php echo trim($second_color); ?>;
--voiture-text-color: <?php echo trim($text_color); ?>;
--voiture-link-color: <?php echo trim($link_color); ?>;
--voiture-link-hover-color: <?php echo trim($link_hover_color); ?>;
--voiture-heading-color: <?php echo trim($heading_color); ?>;
--voiture-theme-hover-color: <?php echo trim($main_hover_color); ?>;
--voiture-second-hover-color: <?php echo trim($second_hover_color); ?>;
--voiture-main-font: <?php echo trim($main_font_family); ?>;
--voiture-main-font-size: <?php echo trim($main_font_size); ?>;
--voiture-main-font-weight: <?php echo trim($main_font_weight); ?>;
--voiture-heading-font: <?php echo trim($heading_font_family); ?>;
--voiture-heading-font-weight: <?php echo trim($heading_font_weight); ?>;
--voiture-theme-color-005: <?php echo voiture_generate_rgba($main_color_rgb, 0.05); ?>
--voiture-theme-color-007: <?php echo voiture_generate_rgba($main_color_rgb, 0.07); ?>
--voiture-theme-color-010: <?php echo voiture_generate_rgba($main_color_rgb, 0.1); ?>
--voiture-theme-color-020: <?php echo voiture_generate_rgba($main_color_rgb, 0.2); ?>
--voiture-second-color-050: <?php echo voiture_generate_rgba($second_color_rgb, 0.5); ?>
}
<?php if ( voiture_get_config('header_mobile_color') != "" ) : ?>
#apus-header-mobile {
background-color: <?php echo esc_html( voiture_get_config('header_mobile_color') ); ?>;
}
<?php endif; ?>
<?php
$content = ob_get_clean();
$content = str_replace(array("\r\n", "\r"), "\n", $content);
$lines = explode("\n", $content);
$new_lines = array();
foreach ($lines as $i => $line) {
if (!empty($line)) {
$new_lines[] = trim($line);
}
}
return implode($new_lines);
}
}