Update default color scheme

This commit is contained in:
Brian Miyaji
2014-12-09 18:10:58 +11:00
parent ea5f928a7a
commit 013cfab5e3
3 changed files with 8 additions and 12 deletions

View File

@@ -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() ) ); $colors = array_map( 'esc_attr', (array) get_option( 'sportspress_frontend_css_colors', array() ) );
// Defaults // 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['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['heading'] ) ) $colors['heading'] = '#ffffff';
if ( empty( $colors['link'] ) ) $colors['link'] = '#00a69c'; 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( __( 'Heading', 'sportspress' ), 'sportspress_frontend_css_heading', $colors['heading'] );
$this->color_picker( __( 'Link', 'sportspress' ), 'sportspress_frontend_css_link', $colors['link'] ); $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> ?><br>
<label for="sportspress_enable_frontend_css"> <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' ); ?>> <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' ); ?>>

View File

@@ -151,19 +151,18 @@ class SP_Frontend_Scripts {
$colors = (array) get_option( 'sportspress_frontend_css_colors', array() ); $colors = (array) get_option( 'sportspress_frontend_css_colors', array() );
// Defaults // 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['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['heading'] ) ) $colors['heading'] = '#ffffff';
if ( empty( $colors['link'] ) ) $colors['link'] = '#00a69c'; if ( empty( $colors['link'] ) ) $colors['link'] = '#00a69c';
// Calculate colors // Calculate colors
$colors['highlight'] = sp_hex_lighter( $colors['background'], 30, true ); $colors['highlight'] = sp_hex_lighter( $colors['background'], 30, true );
$colors['lowlight'] = sp_hex_darker( $colors['background'], 8, true );
echo '<style type="text/css">'; 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 ' /* SportsPress Frontend CSS */ ';
echo '.sp-event-calendar tbody td a,.sp-event-calendar tbody td a:hover{background: none;}'; 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'] ) ) if ( isset( $colors['highlight'] ) )
echo '.sp-highlight,.sp-calendar td#today{background: ' . $colors['highlight'] . ' !important}'; 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 ); do_action( 'sportspress_frontend_css', $colors );
} }

View File

@@ -126,9 +126,9 @@ class SP_Install {
} }
// Default color scheme // 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_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_heading', '#ffffff' );
add_option( 'sportspress_frontend_css_link', '#00a69c' ); add_option( 'sportspress_frontend_css_link', '#00a69c' );