| 1 |
<?php |
| 2 |
|
| 3 |
class WPUPG_Css { |
| 4 |
|
| 5 |
public function __construct() |
| 6 |
{ |
| 7 |
add_action( 'wp_head', array( $this, 'dropdown_filters_css' ), 19 ); |
| 8 |
add_action( 'wp_head', array( $this, 'css' ) ); |
| 9 |
add_action( 'wp_head', array( $this, 'custom_css' ), 20 ); |
| 10 |
} |
| 11 |
|
| 12 |
public function dropdown_filters_css() |
| 13 |
{ |
| 14 |
if( WPUltimatePostGrid::is_premium_active() ) { |
| 15 |
$border_color = WPUltimatePostGrid::option( 'filters_dropdown_border_color', '#AAAAAA' ); |
| 16 |
$text_color = WPUltimatePostGrid::option( 'filters_dropdown_text_color', '#444444' ); |
| 17 |
$background_highlight_color = WPUltimatePostGrid::option( 'filters_dropdown_highlight_background_color', '#5897FB' ); |
| 18 |
$text_highlight_color = WPUltimatePostGrid::option( 'filters_dropdown_highlight_text_color', '#FFFFFF' ); |
| 19 |
|
| 20 |
echo '<style type="text/css">'; |
| 21 |
// Border Color |
| 22 |
echo '.select2wpupg-selection, .select2wpupg-dropdown { border-color: '.$border_color.'!important; }'; |
| 23 |
echo '.select2wpupg-selection__arrow b { border-top-color: '.$border_color.'!important; }'; |
| 24 |
echo '.select2wpupg-container--open .select2wpupg-selection__arrow b { border-bottom-color: '.$border_color.'!important; }'; |
| 25 |
|
| 26 |
// Text color |
| 27 |
echo '.select2wpupg-selection__placeholder, .select2wpupg-search__field, .select2wpupg-selection__rendered, .select2wpupg-results__option { color: '.$text_color.'!important; }'; |
| 28 |
echo '.select2wpupg-search__field::-webkit-input-placeholder { color: '.$text_color.'!important; }'; |
| 29 |
echo '.select2wpupg-search__field:-moz-placeholder { color: '.$text_color.'!important; }'; |
| 30 |
echo '.select2wpupg-search__field::-moz-placeholder { color: '.$text_color.'!important; }'; |
| 31 |
echo '.select2wpupg-search__field:-ms-input-placeholder { color: '.$text_color.'!important; }'; |
| 32 |
|
| 33 |
// Highlight colors |
| 34 |
echo '.select2wpupg-results__option--highlighted { color: '.$text_highlight_color.'!important; background-color: '.$background_highlight_color.'!important; }'; |
| 35 |
|
| 36 |
echo '</style>'; |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
public function css() |
| 41 |
{ |
| 42 |
if( WPUltimatePostGrid::option( 'grid_container_animation_speed', '0.8' ) != '0' ) { |
| 43 |
echo '<style type="text/css">'; |
| 44 |
echo '.wpupg-grid { transition: height ' . WPUltimatePostGrid::option( 'grid_container_animation_speed', '0.8' ) . 's; }'; |
| 45 |
echo '</style>'; |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
public function custom_css() |
| 50 |
{ |
| 51 |
if( WPUltimatePostGrid::option( 'custom_code_public_css', '' ) !== '' ) { |
| 52 |
echo '<style type="text/css">'; |
| 53 |
echo WPUltimatePostGrid::option( 'custom_code_public_css', '' ); |
| 54 |
echo '</style>'; |
| 55 |
} |
| 56 |
} |
| 57 |
} |