'#2b2b2b', 'storefront_footer_heading_color' => '#2b2b2b', 'storefront_button_text_color' => '#2b2b2b', 'storefront_header_background_color' => '#2b2b2b', 'storefront_footer_background_color' => '#2b2b2b', 'storefront_header_link_color' => '#ffffff', 'storefront_header_text_color' => '#ffffff', 'storefront_button_alt_text_color' => '#ffffff', 'storefront_footer_link_color' => '#111111', 'storefront_text_color' => '#777777', 'storefront_footer_text_color' => '#777777', 'storefront_accent_color' => '#7c7235', 'storefront_button_alt_background_color' => '#7c7235', 'storefront_background_color' => '#303030', 'storefront_button_background_color' => '#eeeeee', 'background_color' => '#303030', ) ); } /** * Set default Customizer settings based on Storechild design. * @uses get_boutique_defaults() * @return void */ public function edit_default_customizer_settings( $wp_customize ) { foreach ( Boutique_Customizer::get_boutique_defaults() as $mod => $val ) { $setting = $wp_customize->get_setting( $mod ); if ( is_object( $setting ) ) { $setting->default = $val; } } } /** * Sets default theme color filters for storefront color values. * This function is required for Storefront < 2.0.0 support * @uses get_storechild_defaults() * @return void */ public function default_theme_settings() { $prefix_regex = '/^storefront_/'; foreach ( self::get_boutique_defaults() as $mod => $val) { if ( preg_match( $prefix_regex, $mod ) ) { $filter = preg_replace( $prefix_regex, 'storefront_default_', $mod ); add_filter( $filter, function( $_ ) use ( $val ) { return $val; }, 99 ); } } } /** * Returns a default theme_mod value if there is none set. * @uses get_boutique_defaults() * @return void */ public function default_theme_mod_values() { foreach ( Boutique_Customizer::get_boutique_defaults() as $mod => $val ) { add_filter( 'theme_mod_' . $mod, function( $setting ) use ( $val ) { return $setting ? $setting : $val; }); } } /** * Modify the default controls * @return void */ public function edit_default_controls( $wp_customize ) { $wp_customize->get_setting( 'storefront_header_text_color' )->transport = 'refresh'; } /** * Add CSS using settings obtained from the theme options. * @return void */ public function add_customizer_css() { $header_background_color = get_theme_mod( 'storefront_header_background_color' ); $header_text_color = get_theme_mod( 'storefront_header_text_color' ); $style = ' .main-navigation ul.menu > li > ul, .main-navigation ul.menu ul, .site-header-cart .widget_shopping_cart { background: ' . storefront_adjust_color_brightness( $header_background_color, -10 ) . '; } table th { background-color: ' . storefront_adjust_color_brightness( '#ffffff', -7 ) . '; } table tbody td { background-color: ' . storefront_adjust_color_brightness( '#ffffff', -2 ) . '; } table tbody tr:nth-child(2n) td { background-color: ' . storefront_adjust_color_brightness( '#ffffff', -4 ) . '; } #order_review, #payment .payment_methods li .payment_box { background-color: #fafafa; } #payment .payment_methods li, #payment .payment_methods li:hover { background-color: #fff; } @media screen and (min-width: 768px) { .boutique-primary-navigation, .main-navigation ul.menu ul, .main-navigation ul.nav-menu ul, .main-navigation .smm-mega-menu, .sticky-wrapper, .sd-sticky-navigation, .sd-sticky-navigation:before, .sd-sticky-navigation:after { background: ' . storefront_adjust_color_brightness( $header_background_color, -10 ) . ' !important; } } .main-navigation ul li.smm-active li ul.products li.product h3 { color: ' . $header_text_color . '; }'; wp_add_inline_style( 'storefront-child-style', $style ); } } } return new Boutique_Customizer();