Update default color scheme
This commit is contained in:
@@ -287,9 +287,9 @@ class SP_Settings_General extends SP_Settings_Page {
|
||||
$colors = array_map( 'esc_attr', (array) get_option( 'sportspress_frontend_css_colors', array() ) );
|
||||
|
||||
// Defaults
|
||||
if ( empty( $colors['primary'] ) ) $colors['primary'] = '#00a69c';
|
||||
if ( empty( $colors['primary'] ) ) $colors['primary'] = '#2b353e';
|
||||
if ( empty( $colors['background'] ) ) $colors['background'] = '#f4f4f4';
|
||||
if ( empty( $colors['text'] ) ) $colors['text'] = '#363f48';
|
||||
if ( empty( $colors['text'] ) ) $colors['text'] = '#222222';
|
||||
if ( empty( $colors['heading'] ) ) $colors['heading'] = '#ffffff';
|
||||
if ( empty( $colors['link'] ) ) $colors['link'] = '#00a69c';
|
||||
|
||||
@@ -300,7 +300,7 @@ class SP_Settings_General extends SP_Settings_Page {
|
||||
$this->color_picker( __( 'Heading', 'sportspress' ), 'sportspress_frontend_css_heading', $colors['heading'] );
|
||||
$this->color_picker( __( 'Link', 'sportspress' ), 'sportspress_frontend_css_link', $colors['link'] );
|
||||
|
||||
if ( ( $styles = SP_Frontend_Scripts::get_styles() ) && array_key_exists( 'sportspress-general', $styles ) ):
|
||||
if ( ( $styles = SP_Frontend_Scripts::get_styles() ) && ! current_theme_supports( 'sportspress' ) && array_key_exists( 'sportspress-general', $styles ) ):
|
||||
?><br>
|
||||
<label for="sportspress_enable_frontend_css">
|
||||
<input name="sportspress_enable_frontend_css" id="sportspress_enable_frontend_css" type="checkbox" value="1" <?php checked( get_option( 'sportspress_enable_frontend_css', 'yes' ), 'yes' ); ?>>
|
||||
|
||||
@@ -151,19 +151,18 @@ class SP_Frontend_Scripts {
|
||||
$colors = (array) get_option( 'sportspress_frontend_css_colors', array() );
|
||||
|
||||
// Defaults
|
||||
if ( empty( $colors['primary'] ) ) $colors['primary'] = '#00a69c';
|
||||
if ( empty( $colors['primary'] ) ) $colors['primary'] = '#2b353e';
|
||||
if ( empty( $colors['background'] ) ) $colors['background'] = '#f4f4f4';
|
||||
if ( empty( $colors['text'] ) ) $colors['text'] = '#363f48';
|
||||
if ( empty( $colors['text'] ) ) $colors['text'] = '#222222';
|
||||
if ( empty( $colors['heading'] ) ) $colors['heading'] = '#ffffff';
|
||||
if ( empty( $colors['link'] ) ) $colors['link'] = '#00a69c';
|
||||
|
||||
// Calculate colors
|
||||
$colors['highlight'] = sp_hex_lighter( $colors['background'], 30, true );
|
||||
$colors['lowlight'] = sp_hex_darker( $colors['background'], 8, true );
|
||||
|
||||
echo '<style type="text/css">';
|
||||
|
||||
if ( $enabled == 'yes' && sizeof( $colors ) > 0 ) {
|
||||
if ( $enabled == 'yes' && ! current_theme_supports( 'sportspress' ) && sizeof( $colors ) > 0 ) {
|
||||
echo ' /* SportsPress Frontend CSS */ ';
|
||||
|
||||
echo '.sp-event-calendar tbody td a,.sp-event-calendar tbody td a:hover{background: none;}';
|
||||
@@ -186,9 +185,6 @@ class SP_Frontend_Scripts {
|
||||
if ( isset( $colors['highlight'] ) )
|
||||
echo '.sp-highlight,.sp-calendar td#today{background: ' . $colors['highlight'] . ' !important}';
|
||||
|
||||
if ( isset( $colors['lowlight'] ) )
|
||||
echo '.sp-lowlight,.sp-data-table tbody tr.odd,.sp-data-table tr.alternate{background: ' . $colors['lowlight'] . ' !important}';
|
||||
|
||||
do_action( 'sportspress_frontend_css', $colors );
|
||||
}
|
||||
|
||||
|
||||
@@ -126,9 +126,9 @@ class SP_Install {
|
||||
}
|
||||
|
||||
// Default color scheme
|
||||
add_option( 'sportspress_frontend_css_primary', '#00a69c' );
|
||||
add_option( 'sportspress_frontend_css_primary', '#2b353e' );
|
||||
add_option( 'sportspress_frontend_css_background', '#f4f4f4' );
|
||||
add_option( 'sportspress_frontend_css_text', '#363f48' );
|
||||
add_option( 'sportspress_frontend_css_text', '#222222' );
|
||||
add_option( 'sportspress_frontend_css_heading', '#ffffff' );
|
||||
add_option( 'sportspress_frontend_css_link', '#00a69c' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user