/** * Add custom CSS based on settings in Storefront core * @return void */ function b_add_customizer_css() { $header_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_background_color', apply_filters('storefront_default_header_background_color', '#303030'))); $header_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_text_color', apply_filters('storefront_default_header_text_color', '#9aa0a7'))); $style = ' .boutique-primary-navigation, .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) . '; } @media screen and (min-width: 768px) { .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('boutique-style', $style); }
/** * Add custom CSS based on settings in Storefront core * @return void */ function b_add_customizer_css() { $header_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_text_color', apply_filters('storefront_default_header_text_color', '#9aa0a7'))); $style = ' .main-navigation ul li.smm-active li ul.products li.product h3 { color: ' . $header_text_color . '; }'; wp_add_inline_style('boutique-style', $style); }
function pbosfc_add_customizer_css() { $header_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_background_color', apply_filters('storefront_default_header_background_color', '#2c2d33'))); $header_link_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_link_color', apply_filters('storefront_default_header_link_color', '#ffffff'))); $footer_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_text_color', apply_filters('storefront_default_footer_text_color', '#61656b'))); $product_column_width = (int) pbosfc_get_option('product_columns'); $product_column_width = 100 / ($product_column_width !== 0 ? $product_column_width : 1) - 2; $brighten_factor = apply_filters('storefront_brighten_factor', pbosfc_brighten_factor()); $darken_factor = apply_filters('storefront_darken_factor', pbosfc_darken_factor()); $left_top_menu_width = (string) pbosfc_get_option('left_top_menu_width') . "%"; $left_top_menu_align = (string) pbosfc_get_option('left_top_menu_align'); $right_top_menu_width = (string) pbosfc_get_option('right_top_menu_width') . "%"; $right_top_menu_align = (string) pbosfc_get_option('right_top_menu_align'); // TODO: (not importrant) umozliwic ustawianie doklaniej kolorow top menu $top_menu_background_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_top_menu_background_color', pbosfc_get_option_def('top_menu_background_color'))); $top_menu_1level_background_color = $top_menu_background_color; //'#f3f3f3'; $top_menu_1level_link_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_top_menu_1level_link_color', pbosfc_get_option_def('top_menu_1level_link_color'))); $top_menu_2level_background_color = $top_menu_background_color; //'#f3f3f3'; $top_menu_2level_link_color = $top_menu_1level_link_color; //'#96588a'; // TODO: (not importrant) umozliwic ustawianie dokladniej kolorow glownego menu $main_navigation_1level_background_color = $header_background_color; //'#2c2d33'; $main_navigation_1level_link_color = $header_link_color; //'#ffffff'; $main_navigation_2level_background_color = $header_background_color; //'#2c2d33'; $main_navigation_2level_link_color = $header_link_color; //'#ffffff'; $main_navigation_text_align = pbosfc_get_option('main_navigation_text_align'); $site_title_link_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_site_title_link_color', pbosfc_get_option_def('site_title_link_color'))); $site_title_text_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_site_title_text_color', pbosfc_get_option_def('site_title_text_color'))); $site_header_search_background_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_site_header_search_background_color', pbosfc_get_option_def('site_header_search_background_color'))); $site_header_search_text_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_site_header_search_text_color', pbosfc_get_option_def('site_header_search_text_color'))); $site_header_cart_background_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_site_header_cart_background_color', pbosfc_get_option_def('site_header_cart_background_color'))); $site_header_cart_link_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_site_header_cart_link_color', pbosfc_get_option_def('site_header_cart_link_color'))); $site_header_cart_content_background_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_site_header_cart_content_background_color', pbosfc_get_option_def('site_header_cart_content_background_color'))); $site_header_cart_content_link_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_site_header_cart_content_link_color', pbosfc_get_option_def('site_header_cart_content_link_color'))); $site_header_cart_content_text_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_site_header_cart_content_text_color', pbosfc_get_option_def('site_header_cart_content_text_color'))); $onsale_sign_background_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_onsale_sign_background_color', pbosfc_get_option_def('onsale_sign_background_color'))); $onsale_sign_border_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_onsale_sign_border_color', pbosfc_get_option_def('onsale_sign_border_color'))); $onsale_sign_text_color = storefront_sanitize_hex_color(get_theme_mod('pbosfc_onsale_sign_text_color', pbosfc_get_option_def('onsale_sign_text_color'))); $styles = "\n\t\t/* Fixing some Storefront bugs ;) */\n\n\t\t.footer-widgets ul.menu li.current-menu-item > a {\n\t\t\tcolor: {$footer_text_color};\n\t\t}\n\n\t\t/* Site title */\n\n\t\tul.menu li a,\n\t\t.site-title a,\n\t\t.site-branding h1 a {\n\t\t\tcolor: {$site_title_link_color};\n\t\t}\n\t\t.site-title a:hover,\n\t\t.site-branding h1 a:hover {\n\t\t\tcolor: " . storefront_adjust_color_brightness($site_title_link_color, $darken_factor) . ";\n\t\t}\n\t\tp.site-description {\n\t\t\tcolor: {$site_title_text_color};\n\t\t}\n\n\n\t\t@media screen and ( min-width: 768px ) {\n\n\t\t\t/* Category/product columns on archives pages */\n\n\t\t\t.site-main ul.products li.product {\n width : {$product_column_width}%;\n margin-right : 2%;\n float: left;\n }\n\n\t\t\t/* Top menu */\n\n\t\t\t.top-menu-wrap {\n\t\t\t\tbackground-color: {$top_menu_background_color};\n\t\t\t}\n\n\t\t\t.left-top-menu-wrap {\n\t\t\t\twidth : {$left_top_menu_width};\n\t\t\t\tmin-width: {$left_top_menu_width};\n\t\t\t\tbackground-color: {$top_menu_1level_background_color};\n\t\t\t}\n\t\t .left-top-menu .menu {\n\t\t float : {$left_top_menu_align};\n\t\t }\n\n\t\t\t.right-top-menu-wrap {\n\t\t\t\twidth : {$right_top_menu_width};\n\t\t\t\tmin-width: {$right_top_menu_width};\n\t\t\t\tbackground-color: {$top_menu_1level_background_color};\n\t\t\t}\n\t\t .right-top-menu .menu {\n\t\t float : {$right_top_menu_align};\n\t\t }\n\n\t\t\t.left-top-menu .menu a,\n\t\t\t.right-top-menu .menu a,\n\t\t\t.left-top-menu ul.menu li.current-menu-item > a,\n\t\t\t.right-top-menu ul.menu li.current-menu-item > a {\n\t\t\t\tcolor: {$top_menu_1level_link_color};\n\t\t\t\tbackground-color: {$top_menu_1level_background_color};\n\t\t\t}\n\n\t\t\t.left-top-menu .menu a:hover,\n\t\t\t.right-top-menu .menu a:hover,\n\t\t\t.left-top-menu ul.menu li.current-menu-item > a:hover,\n\t\t\t.right-top-menu ul.menu li.current-menu-item > a:hover {\n\t\t\t\tcolor: " . storefront_adjust_color_brightness($top_menu_1level_link_color, $darken_factor) . ";\n\t\t\t\tbackground-color: " . storefront_adjust_color_brightness($top_menu_1level_background_color, $brighten_factor) . ";\n\t\t\t}\n\n\t\t\t.left-top-menu .menu ul a,\n\t\t\t.right-top-menu .menu ul a {\n\t\t\t\tcolor: {$top_menu_2level_link_color};\n\t\t\t\tbackground-color: {$top_menu_2level_background_color};\n\t\t\t}\n\n\t\t\t.left-top-menu .menu ul a:hover,\n\t\t\t.right-top-menu .menu ul a:hover {\n\t\t\t\tcolor: " . storefront_adjust_color_brightness($top_menu_2level_link_color, $darken_factor) . ";\n\t\t\t\tbackground-color: " . storefront_adjust_color_brightness($top_menu_2level_background_color, $brighten_factor) . ";\n\t\t\t}\n\n\t\t}\n\n\t\t/* Main menu */\n\n\t\t/* first (and rest on mobile) level */\n\n\t\t.main-navigation,\n\t\t.main-navigation ul li a {\n\t\t\tcolor: {$main_navigation_1level_link_color};\n\t\t background-color: {$main_navigation_1level_background_color};\n\t\t}\n\n\t\t.main-navigation ul li a:hover {\n\t\t\tcolor: " . storefront_adjust_color_brightness($main_navigation_1level_link_color, $darken_factor) . ";\n\t\t\tbackground-color: " . storefront_adjust_color_brightness($main_navigation_1level_background_color, $brighten_factor) . ";\n\t\t}\n\n\n\t\t@media screen and ( min-width: 768px ) {\n\n\t\t\t.woocommerce-active .site-header .main-navigation,\n\t\t\t.site-header .main-navigation {\n\t\t\t\ttext-align: {$main_navigation_text_align}\n\t\t\t}\n\n\t\t\t/* second level, desktops */\n\n\t\t\t.main-navigation ul.menu ul li a {\n\t\t\t\tcolor: {$main_navigation_2level_link_color};\n\t\t\t\tbackground-color: {$main_navigation_2level_background_color};\n\t\t\t}\n\t\t\t.main-navigation ul.menu ul li a:hover {\n\t\t\t\tcolor: " . storefront_adjust_color_brightness($main_navigation_2level_link_color, $darken_factor) . ";\n\t\t\t\tbackground-color: " . storefront_adjust_color_brightness($main_navigation_2level_background_color, $brighten_factor) . ";\n\t\t\t}\n\t\t}\n\n\n\t\t/* Wishlist link (on mobile) */\n\n\t\t.site-header-wishlist a {\n\t\t\tcolor: {$header_link_color};\n\t\t}\n\t\t.site-header-wishlist a:hover {\n\t\t\tcolor: " . storefront_adjust_color_brightness($header_link_color, $darken_factor) . ";\n\t\t}\n\n\t\t/* Search box */\n\n\t\t.widget_search form input[type=text],\n\t\t.widget_search form input[type=search],\n\t\t.widget_product_search form input[type=text],\n\t\t.widget_product_search form input[type=search] {\n\t\t\tbackground-color: {$site_header_search_background_color};\n\t\t\tcolor : {$site_header_search_text_color};\n\t\t}\n\n\t\t/* Mini Cart */\n\n\t\t.site-header-cart .cart-contents,\n\t\t.widget .site-header-cart .cart-contents,\n\t\t.woocommerce-active .site-header .site-header-cart {\n\t\t\tbackground-color : {$site_header_cart_background_color};\n\t\t\tcolor: {$site_header_cart_link_color};\n\t\t}\n\n\t\t.site-header-cart .widget_shopping_cart {\n\t\t\tbackground-color: {$site_header_cart_content_background_color};\n\t\t\tcolor: {$site_header_cart_content_text_color};\n\t\t}\n\t\t.site-header .product_list_widget li .quantity,\n\t\t.widget_shopping_cart .product_list_widget li .quantity {\n\t\t\tcolor: {$site_header_cart_content_text_color};\n\t\t}\n\n\t\ta.cart-contents,\n\t\t.widget a.cart-contents {\n\t\t\tcolor: {$site_header_cart_link_color};\n\t\t}\n\t\t.site-header-cart .widget_shopping_cart a {\n\t\t\tcolor: {$site_header_cart_content_link_color};\n\t\t}\n\t\ta.cart-contents:hover,\n\t\t.widget a.cart-contents:hover {\n\t\t\tcolor: " . storefront_adjust_color_brightness($site_header_cart_link_color, $darken_factor) . ";\n\t\t}\n\t\t.site-header-cart .widget_shopping_cart a:hover {\n\t\t\tcolor: " . storefront_adjust_color_brightness($site_header_cart_content_link_color, $darken_factor) . ";\n\t\t}\n\n\t\t/* On Sale sign */\n\n\t\t.woocommerce span.onsale {\n\t\t\tbackground-color: {$onsale_sign_background_color};\n\t\t\tborder-color: {$onsale_sign_border_color};\n\t\t\tcolor: {$onsale_sign_text_color};\n\t\t}\n\t"; // Some fixes for Firefox (on Linux) $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; if ((bool) preg_match("/firefox/i", $user_agent)) { $styles = $styles . "\n\t\t\t/*@media screen and ( min-width: 768px ) {*/\n\t\t\t\t.site-branding h1 {\n\t\t\t\t\tfont-size : 1.35em;\n\t\t\t\t}\n\n\t\t\t\t.site-header-wishlist a {\n\t\t\t\t\tfont-size : 0.6em;\n\t\t\t\t}\n\n\t\t\t\t.woocommerce-active .site-header .main-navigation,\n\t\t\t\t.site-header .main-navigation {\n\t\t\t\t\tfont-size : 1.05em;\n\t\t\t\t}\n\t\t\t/*}*/\n\t\t"; } $styles = pbo_compact_css($styles); wp_add_inline_style('pbosfc-style', apply_filters('pbosfc_inline_styles', $styles)); }
/** * Add custom CSS based on settings in Storefront core * @return void */ function deli_add_customizer_css() { $navigation_bg_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_background_color', apply_filters('storefront_default_header_background_color', '#fcfcfc'))); $accent_color = storefront_sanitize_hex_color(get_theme_mod('storefront_accent_color')); $footer_link_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_link_color', apply_filters('storefront_default_footer_link_color', '#96588a'))); $footer_heading_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_heading_color', apply_filters('storefront_default_footer_heading_color', '#494c50'))); $footer_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_text_color', apply_filters('storefront_default_footer_text_color', '#61656b'))); $button_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_background_color', apply_filters('storefront_default_button_background_color', '#60646c'))); $button_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_text_color', apply_filters('storefront_default_button_text_color', '#ffffff'))); $header_bg_color = storefront_sanitize_hex_color(get_theme_mod('deli_header_background_color', '')); $darken_factor = -15; $lighten_factor = 15; $style = ' .deli-primary-navigation { background:' . $navigation_bg_color . '; } .single-product div.product .summary .price { color: ' . $accent_color . '; } .header-widget-region { color: ' . $footer_text_color . '; } .header-widget-region a:not(.button) { color: ' . $footer_link_color . '; } .single-product div.product .summary .price { color: ' . $button_text_color . '; background-color: ' . $button_background_color . '; } .header-widget-region h1, .header-widget-region h2, .header-widget-region h3, .header-widget-region h4, .header-widget-region h5, .header-widget-region h6 { color: ' . $footer_heading_color . '; }'; if (class_exists('Storefront_Designer')) { $sticky = get_theme_mod('sd_header_sticky', 'default'); if ('sticky-header' == $sticky) { $style .= ' .site-header { background-color:' . $header_bg_color . ' !important; } '; } } wp_add_inline_style('deli-style', $style); }
/** * Add custom CSS based on settings in Storefront core * @return void */ function deli_add_extension_customizer_css() { if (class_exists('Storefront_Designer')) { $content_background_color = storefront_sanitize_hex_color(get_theme_mod('sd_content_background_color', apply_filters('deli_default_content_background_color', '#f9f9f9'))); $style = ' .content-area { background-color: ' . $content_background_color . '; } .site-main:before { background: -webkit-linear-gradient(rgba(#000,0) 0%, transparent 0%), -webkit-linear-gradient(135deg, ' . $content_background_color . ' 33.33%, transparent 33.33%) 0 0%, rgba(#000,0) -webkit-linear-gradient(45deg, ' . $content_background_color . ' 33.33%, rgba(#000,0) 33.33%) 0 0%; } '; wp_add_inline_style('deli-style', $style); } }
/** * Add custom CSS based on settings in Storefront core * @return void */ function p_add_customizer_css() { $primary_nav_color = storefront_sanitize_hex_color(get_theme_mod('proshop_navigation_color', '#444444')); $primary_nav_bg_color = storefront_sanitize_hex_color(get_theme_mod('proshop_navigation_background_color', '#ffffff')); $header_link_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_link_color', apply_filters('storefront_default_header_link_color', '#ffffff'))); $header_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_background_color', apply_filters('storefront_default_header_background_color', '#2c2d33'))); $header_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_text_color', apply_filters('storefront_default_header_text_color', '#9aa0a7'))); $accent_color = storefront_sanitize_hex_color(get_theme_mod('storefront_accent_color', apply_filters('proshop_default_accent_color', '#00a5bf'))); $content_bg_color = storefront_sanitize_hex_color(get_theme_mod('sd_content_background_color')); $content_frame = get_theme_mod('sd_fixed_width'); if ($content_bg_color && 'true' == $content_frame && class_exists('Storefront_Designer')) { $bg_color = str_replace('#', '', $content_bg_color); } else { $bg_color = get_theme_mod('background_color', apply_filters('proshop_default_bg_color', 'e8e8e8')); } $button_alt_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_alt_background_color', apply_filters('proshop_default_button_alt_background_color', '#d84b2f'))); $button_alt_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_alt_text_color', apply_filters('proshop_default_button_alt_text_color', '#ffffff'))); $style = ' .p-primary-navigation, .main-navigation ul.menu ul, .sticky-wrapper, .sd-sticky-navigation, .sd-sticky-navigation:before, .sd-sticky-navigation:after, .main-navigation ul.nav-menu ul { background-color: ' . $primary_nav_bg_color . ' !important; } .main-navigation ul.nav-menu .smm-active ul { background-color: transparent !important; } .main-navigation ul li a { color: ' . $primary_nav_color . '; } .main-navigation ul li.smm-active li a { color: ' . $header_link_color . '; } .main-navigation ul li.smm-active li ul.products li.product h3 { color: ' . $header_text_color . '; } .main-navigation li.current-menu-item > a, .main-navigation ul li a:hover { color: ' . storefront_adjust_color_brightness($primary_nav_color, 50) . ' !important; } ul.products li.product.product-category h3 { background-color: ' . $button_alt_background_color . '; } ul.products li.product.product-category:hover h3 { background-color: ' . storefront_adjust_color_brightness($button_alt_background_color, -15) . '; } ul.products li.product.product-category h3, ul.products li.product.product-category h3 mark { color: ' . $button_alt_text_color . '; } .storefront-product-section .section-title span, .storefront-product-section .section-title span:before, .storefront-product-section .section-title span:after, #respond { background-color: ' . storefront_adjust_color_brightness($bg_color, 10) . '; } .storefront-product-section .section-title span:before, .storefront-product-section .section-title span:after, .storefront-product-section .section-title span, .widget-area .widget:before, .widget-area .widget:after, .widget-area .widget { border-color: ' . storefront_adjust_color_brightness($bg_color, 18) . ' } .widget-area .widget, .widget-area .widget:before, .widget-area .widget:after { background-color: ' . storefront_adjust_color_brightness($bg_color, 10) . '; } ul.products li.product img, ul.products li.product .price, ul.products li.product .price:after, .single-product .images img, input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], textarea, .input-text { background-color: ' . storefront_adjust_color_brightness($bg_color, 15) . '; } ul.products li.product .price:before { border-left-color: ' . storefront_adjust_color_brightness($bg_color, 15) . '; } .woocommerce-active .site-header .site-search input[type=search] { box-shadow: 0 0 0 3px ' . $accent_color . '; } .woocommerce-active .site-header .site-search .widget_product_search form:before { color: ' . $header_link_color . '; } .smm-mega-menu { background-color: ' . $header_background_color . '; } @media screen and (min-width: 768px) { .p-primary-navigation { border-top-color: ' . $header_background_color . '; } .woocommerce-active .site-header .site-header-cart a.cart-contents:after, .woocommerce-active .site-header .site-search .widget_product_search form:before, .widget-area .widget .widget-title:after, .main-navigation ul.menu li.current-menu-item > a:before, .main-navigation ul.nav-menu li.current-menu-item > a:before { background-color: ' . $accent_color . '; } .woocommerce-active .site-header .site-header-cart a.cart-contents:hover:after { background-color: ' . storefront_adjust_color_brightness($accent_color, 5) . '; } .storefront-product-section.storefront-product-categories .columns-3 ul.products li.product:after, .storefront-product-section.storefront-product-categories .columns-3 ul.products li.product:before { background-color: #' . $bg_color . '; background-image: url(' . get_background_image() . '); } .site-header-cart .widget_shopping_cart a.button { background-color: ' . storefront_adjust_color_brightness($header_background_color, -15) . '; } } '; wp_add_inline_style('p-style', $style); }
/** * Enqueue CSS and custom styles. * @since 1.0.0 * @return void */ public function ssatc_script() { $theme = wp_get_theme(); wp_enqueue_style('ssatc-styles', plugins_url('/assets/css/style.css', __FILE__)); wp_register_script('waypoints', plugins_url('/assets/js/jquery.waypoints.min.js', __FILE__), array('jquery'), '4.0.0'); wp_register_script('waypoints-init', plugins_url('/assets/js/waypoints.init.min.js', __FILE__), array('jquery')); // If Storefront is the active parent theme, add some styles if ('Storefront' == $theme->name || 'storefront' == $theme->template) { $content_bg_color = storefront_sanitize_hex_color(get_theme_mod('sd_content_background_color')); $content_frame = get_theme_mod('sd_fixed_width'); if ($content_bg_color && 'true' == $content_frame && class_exists('Storefront_Designer')) { $bg_color = str_replace('#', '', $content_bg_color); } else { $bg_color = str_replace('#', '', get_theme_mod('background_color')); } $accent_color = storefront_sanitize_hex_color(get_theme_mod('storefront_accent_color', apply_filters('storefront_default_accent_color', '#96588a'))); $text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_text_color', apply_filters('storefront_default_text_color', '#60646c'))); $ssatc_style = ' .ssatc-sticky-add-to-cart { background-color: #' . $bg_color . '; color: ' . $text_color . '; } .ssatc-sticky-add-to-cart a:not(.button) { color: ' . $accent_color . '; }'; wp_add_inline_style('ssatc-styles', $ssatc_style); } }
function storefront_add_customizer_css() { $accent_color = storefront_sanitize_hex_color(get_theme_mod('storefront_accent_color', apply_filters('storefront_default_accent_color', '#484C52'))); $header_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_background_color', apply_filters('storefront_default_header_background_color', '#2c2d33'))); $header_link_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_link_color', apply_filters('storefront_default_header_link_color', '#ffffff'))); $header_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_text_color', apply_filters('storefront_default_header_text_color', '#9aa0a7'))); $footer_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_background_color', apply_filters('storefront_default_footer_background_color', '#f3f3f3'))); $footer_link_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_link_color', apply_filters('storefront_default_footer_link_color', '#484C52'))); $footer_heading_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_heading_color', apply_filters('storefront_default_footer_heading_color', '#494c50'))); $footer_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_text_color', apply_filters('storefront_default_footer_text_color', '#61656b'))); $text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_text_color', apply_filters('storefront_default_text_color', '#60646c'))); $heading_color = storefront_sanitize_hex_color(get_theme_mod('storefront_heading_color', apply_filters('storefront_default_heading_color', '#484c51'))); $button_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_background_color', apply_filters('storefront_default_button_background_color', '#60646c'))); $button_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_text_color', apply_filters('storefront_default_button_text_color', '#ffffff'))); $button_alt_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_alt_background_color', apply_filters('storefront_default_button_alt_background_color', '#484C52'))); $button_alt_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_alt_text_color', apply_filters('storefront_default_button_alt_text_color', '#ffffff'))); $brighten_factor = apply_filters('storefront_brighten_factor', 25); $darken_factor = apply_filters('storefront_darken_factor', -25); $style = ' .main-navigation ul li a, .site-title a, ul.menu li a, .site-branding h1 a { color: ' . $header_link_color . '; } .main-navigation ul li a:hover, .site-title a:hover { color: ' . storefront_adjust_color_brightness($header_link_color, $darken_factor) . '; } .site-header, .main-navigation ul ul, .secondary-navigation ul ul, .main-navigation ul.menu > li.menu-item-has-children:after, .secondary-navigation ul.menu ul, .main-navigation ul.menu ul, .main-navigation ul.nav-menu ul { background-color: ' . $header_background_color . '; } p.site-description, ul.menu li.current-menu-item > a { color: ' . $header_text_color . '; } h1, h2, h3, h4, h5, h6 { color: ' . $heading_color . '; } .hentry .entry-header { border-color: ' . $heading_color . '; } .widget h1 { border-bottom-color: ' . $heading_color . '; } body, .secondary-navigation a, .widget-area .widget a, .onsale, #comments .comment-list .reply a, .pagination .page-numbers li .page-numbers:not(.current), .woocommerce-pagination .page-numbers li .page-numbers:not(.current) { color: ' . $text_color . '; } a { color: ' . $accent_color . '; } a:focus, .button:focus, .button.alt:focus, .button.added_to_cart:focus, .button.wc-forward:focus, button:focus, input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus { outline-color: ' . $accent_color . '; } button, input[type="button"], input[type="reset"], input[type="submit"], .button, .added_to_cart, .widget-area .widget a.button, .site-header-cart .widget_shopping_cart a.button { background-color: ' . $button_background_color . '; border-color: ' . $button_background_color . '; color: ' . $button_text_color . '; } button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover, .button:hover, .added_to_cart:hover, .widget-area .widget a.button:hover, .site-header-cart .widget_shopping_cart a.button:hover { background-color: ' . storefront_adjust_color_brightness($button_background_color, $darken_factor) . '; border-color: ' . storefront_adjust_color_brightness($button_background_color, $darken_factor) . '; color: ' . $button_text_color . '; } button.alt, input[type="button"].alt, input[type="reset"].alt, input[type="submit"].alt, .button.alt, .added_to_cart.alt, .widget-area .widget a.button.alt, .added_to_cart, .pagination .page-numbers li .page-numbers.current, .woocommerce-pagination .page-numbers li .page-numbers.current { background-color: ' . $button_alt_background_color . '; border-color: ' . $button_alt_background_color . '; color: ' . $button_alt_text_color . '; } button.alt:hover, input[type="button"].alt:hover, input[type="reset"].alt:hover, input[type="submit"].alt:hover, .button.alt:hover, .added_to_cart.alt:hover, .widget-area .widget a.button.alt:hover, .added_to_cart:hover { background-color: ' . storefront_adjust_color_brightness($button_alt_background_color, $darken_factor) . '; border-color: ' . storefront_adjust_color_brightness($button_alt_background_color, $darken_factor) . '; color: ' . $button_alt_text_color . '; } .site-footer { background-color: ' . $footer_background_color . '; color: ' . $footer_text_color . '; } .site-footer a:not(.button) { color: ' . $footer_link_color . '; } .site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4, .site-footer h5, .site-footer h6 { color: ' . $footer_heading_color . '; } @media screen and ( min-width: 768px ) { .main-navigation ul.menu > li > ul { border-top-color: ' . $header_background_color . '; } .secondary-navigation ul.menu a:hover { color: ' . storefront_adjust_color_brightness($header_text_color, $brighten_factor) . '; } .main-navigation ul.menu ul { background-color: ' . $header_background_color . '; } .secondary-navigation ul.menu a { color: ' . $header_text_color . '; } }'; $woocommerce_style = ' a.cart-contents, .site-header-cart .widget_shopping_cart a { color: ' . $header_link_color . '; } a.cart-contents:hover, .site-header-cart .widget_shopping_cart a:hover { color: ' . storefront_adjust_color_brightness($header_link_color, $darken_factor) . '; } .site-header-cart .widget_shopping_cart { background-color: ' . $header_background_color . '; } .woocommerce-tabs ul.tabs li.active a, ul.products li.product .price, .onsale { color: ' . $text_color . '; } .onsale { border-color: ' . $text_color . '; } .star-rating span:before, .widget-area .widget a:hover, .product_list_widget a:hover, .quantity .plus, .quantity .minus, p.stars a:hover:after, p.stars a:after, .star-rating span:before { color: ' . $accent_color . '; } .widget_price_filter .ui-slider .ui-slider-range, .widget_price_filter .ui-slider .ui-slider-handle { background-color: ' . $accent_color . '; } #order_review_heading, #order_review { border-color: ' . $accent_color . '; } @media screen and ( min-width: 768px ) { .site-header-cart .widget_shopping_cart, .site-header .product_list_widget li .quantity { color: ' . $header_text_color . '; } }'; wp_add_inline_style('storefront-style', $style); wp_add_inline_style('storefront-woocommerce-style', $woocommerce_style); }
function storefront_add_integrations_customizer_css() { if (is_storefront_customizer_enabled()) { $accent_color = storefront_sanitize_hex_color(get_theme_mod('storefront_accent_color', apply_filters('storefront_default_accent_color', '#96588a'))); $header_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_text_color', apply_filters('storefront_default_header_text_color', '#9aa0a7'))); $header_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_background_color', apply_filters('storefront_default_header_background_color', '#2c2d33'))); $text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_text_color', apply_filters('storefront_default_text_color', '#60646c'))); $button_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_background_color', apply_filters('storefront_default_button_background_color', '#60646c'))); $button_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_text_color', apply_filters('storefront_default_button_text_color', '#ffffff'))); $woocommerce_style = ''; if (is_woocommerce_extension_activated('WC_Bookings')) { $woocommerce_style .= ' #wc-bookings-booking-form .wc-bookings-date-picker .ui-datepicker td.bookable a, #wc-bookings-booking-form .wc-bookings-date-picker .ui-datepicker td.bookable a:hover, #wc-bookings-booking-form .block-picker li a:hover, #wc-bookings-booking-form .block-picker li a.selected { background-color: ' . $accent_color . ' !important; } #wc-bookings-booking-form .wc-bookings-date-picker .ui-datepicker td.ui-state-disabled .ui-state-default, #wc-bookings-booking-form .wc-bookings-date-picker .ui-datepicker th { color:' . $text_color . '; } #wc-bookings-booking-form .wc-bookings-date-picker .ui-datepicker-header { background-color: ' . $header_background_color . '; color: ' . $header_text_color . '; }'; } if (is_woocommerce_extension_activated('WC_Product_Reviews_Pro')) { $woocommerce_style .= ' .woocommerce #reviews .product-rating .product-rating-details table td.rating-graph .bar, .woocommerce-page #reviews .product-rating .product-rating-details table td.rating-graph .bar { background-color: ' . $text_color . ' !important; } .woocommerce #reviews .contribution-actions .feedback, .woocommerce-page #reviews .contribution-actions .feedback, .star-rating-selector:not(:checked) label.checkbox { color: ' . $text_color . '; } .woocommerce #reviews #comments ol.commentlist li .contribution-actions a, .woocommerce-page #reviews #comments ol.commentlist li .contribution-actions a, .star-rating-selector:not(:checked) input:checked ~ label.checkbox, .star-rating-selector:not(:checked) label.checkbox:hover ~ label.checkbox, .star-rating-selector:not(:checked) label.checkbox:hover, .woocommerce #reviews #comments ol.commentlist li .contribution-actions a, .woocommerce-page #reviews #comments ol.commentlist li .contribution-actions a, .woocommerce #reviews .form-contribution .attachment-type:not(:checked) label.checkbox:before, .woocommerce-page #reviews .form-contribution .attachment-type:not(:checked) label.checkbox:before { color: ' . $accent_color . ' !important; }'; } if (is_woocommerce_extension_activated('WC_Smart_Coupons')) { $woocommerce_style .= ' .coupon-container { background-color: ' . $button_background_color . ' !important; } .coupon-content { border-color: ' . $button_text_color . ' !important; color: ' . $button_text_color . '; } .sd-buttons-transparent.woocommerce .coupon-content, .sd-buttons-transparent.woocommerce-page .coupon-content { border-color: ' . $button_background_color . ' !important; }'; } wp_add_inline_style('storefront-style', $woocommerce_style); } }
/** * Add CSS in <head> for styles handled by the Customizer * * @since 1.0.0 */ public function shm_add_customizer_css() { $header_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_background_color', apply_filters('storefront_default_header_background_color', '#2c2d33'))); $header_link_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_link_color', apply_filters('storefront_default_header_link_color', '#ffffff'))); $wc_style = ' @media screen and (max-width: 768px) { .menu-toggle { color: ' . $header_link_color . '; } .menu-toggle:hover { color: ' . storefront_adjust_color_brightness($header_link_color, -100) . '; } .main-navigation div.menu, .main-navigation .handheld-navigation { background-color: ' . $header_background_color . '; } .main-navigation ul li a, ul.menu li a { color: ' . $header_link_color . '; } } '; wp_add_inline_style('storefront-woocommerce-style', $wc_style); }
/** * Add CSS in <head> for styles handled by the Customizer * * @since 1.0.0 */ public function swc_add_customizer_css() { $success_bg_color = storefront_sanitize_hex_color(get_theme_mod('swc_message_background_color', apply_filters('swc_default_message_background_color', '#0f834d'))); $success_text_color = storefront_sanitize_hex_color(get_theme_mod('swc_message_text_color', apply_filters('swc_default_message_text_color', '#ffffff'))); $message_bg_color = storefront_sanitize_hex_color(get_theme_mod('swc_info_background_color', apply_filters('swc_default_info_background_color', '#3D9CD2'))); $message_text_color = storefront_sanitize_hex_color(get_theme_mod('swc_info_text_color', apply_filters('swc_default_info_text_color', '#ffffff'))); $error_bg_color = storefront_sanitize_hex_color(get_theme_mod('swc_error_background_color', apply_filters('swc_default_error_background_color', '#e2401c'))); $error_text_color = storefront_sanitize_hex_color(get_theme_mod('swc_error_text_color', apply_filters('swc_default_error_text_color', '#ffffff'))); $wc_style = ''; $wc_style .= ' .woocommerce-message { background-color: ' . $success_bg_color . ' !important; color: ' . $success_text_color . ' !important; } .woocommerce-message a, .woocommerce-message a:hover, .woocommerce-message .button, .woocommerce-message .button:hover { color: ' . $success_text_color . ' !important; } .woocommerce-info { background-color: ' . $message_bg_color . ' !important; color: ' . $message_text_color . ' !important; } .woocommerce-info a, .woocommerce-info a:hover, .woocommerce-info .button, .woocommerce-info .button:hover { color: ' . $message_text_color . ' !important; } .woocommerce-error { background-color: ' . $error_bg_color . ' !important; color: ' . $error_text_color . ' !important; } .woocommerce-error a, .woocommerce-error a:hover, .woocommerce-error .button, .woocommerce-error .button:hover { color: ' . $error_text_color . ' !important; } '; wp_add_inline_style('storefront-woocommerce-style', $wc_style); }
/** * Enqueue CSS and custom styles. * @since 1.0.0 * @return void */ public function sfb_styles() { wp_enqueue_style('sfb-styles', plugins_url('/assets/css/style.css', __FILE__)); $footer_bar_bg_image = esc_url(get_theme_mod('sfb_background_image', '')); $footer_bar_bg = storefront_sanitize_hex_color(get_theme_mod('sfb_background_color', apply_filters('storefront_default_header_background_color', '#2c2d33'))); $footer_bar_text = storefront_sanitize_hex_color(get_theme_mod('sfb_text_color', apply_filters('storefront_default_header_text_color', '#9aa0a7'))); $footer_bar_headings = storefront_sanitize_hex_color(get_theme_mod('sfb_heading_color', apply_filters('sfb_default_heading_color', '#ffffff'))); $footer_bar_links = storefront_sanitize_hex_color(get_theme_mod('sfb_link_color', apply_filters('storefront_default_header_link_color', '#ffffff'))); $sfb_style = ' .sfb-footer-bar { background-color: ' . $footer_bar_bg . '; background-image: url(' . $footer_bar_bg_image . '); } .sfb-footer-bar .widget { color: ' . $footer_bar_text . '; } .sfb-footer-bar .widget h1, .sfb-footer-bar .widget h2, .sfb-footer-bar .widget h3, .sfb-footer-bar .widget h4, .sfb-footer-bar .widget h5, .sfb-footer-bar .widget h6 { color: ' . $footer_bar_headings . '; } .sfb-footer-bar .widget a { color: ' . $footer_bar_links . '; }'; wp_add_inline_style('sfb-styles', $sfb_style); }
/** * Add custom CSS based on settings in Storefront core * @return void */ function g_add_customizer_css() { $header_bg_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_background_color', apply_filters('galleria_default_header_background_color', '#ffffff'))); $accent_color = storefront_sanitize_hex_color(get_theme_mod('storefront_accent_color', apply_filters('galleria_default_accent_color', '#cf5916'))); $header_link_color = storefront_sanitize_hex_color(get_theme_mod('storefront_header_link_color', apply_filters('galleria_default_header_background_color', '#2b2b2b'))); $bg_color = get_background_color(); $text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_text_color', apply_filters('galleria_default_text_color', '#2b2b2b'))); $button_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_text_color', apply_filters('storefront_default_button_text_color', '#ffffff'))); $button_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_background_color', apply_filters('galleria_default_button_background_color', '#2b2b2b'))); $button_alt_background_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_alt_background_color', apply_filters('galleria_default_button_alt_background_color', '#c41f61'))); $button_alt_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_button_alt_text_color', apply_filters('storefront_default_button_alt_text_color', '#ffffff'))); $brighten_factor = apply_filters('storefront_brighten_factor', 25); $darken_factor = apply_filters('storefront_darken_factor', -25); $style = ' .onsale { background-color: ' . $button_alt_background_color . '; color: ' . $button_alt_text_color . '; } .woocommerce-pagination .page-numbers li .page-numbers.current, .pagination .page-numbers li .page-numbers.current { background-color: #' . $bg_color . '; color: ' . $text_color . '; } button, input[type="button"], input[type="reset"], input[type="submit"], .button, .added_to_cart, .widget-area .widget a.button, .site-header-cart .widget_shopping_cart a.button, button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover, .button:hover, .added_to_cart:hover, .widget-area .widget a.button:hover, .site-header-cart .widget_shopping_cart a.button:hover { border-color: ' . $button_text_color . '; } @media screen and (min-width: 768px) { ul.products li.product .g-product-title, ul.products li.product .g-product-title h3 { background-color: ' . $header_link_color . '; color: ' . $header_bg_color . '; } ul.products li.product-category a { background-color: ' . $header_bg_color . '; } ul.products li.product-category .g-product-title h3 { color: ' . $header_link_color . '; } ul.products li.product .g-product-title .price { color: ' . $header_bg_color . '; } .main-navigation ul.menu > li:first-child:before, .main-navigation ul.menu > li:last-child:after, .main-navigation ul.nav-menu > li:first-child:before, .main-navigation ul.nav-menu > li:last-child:after { color: ' . $header_link_color . '; } .site-header .g-primary-navigation, .footer-widgets, .site-footer, .main-navigation ul.menu ul.sub-menu, .main-navigation ul.nav-menu ul.sub-menu, .site-header-cart .widget_shopping_cart, .site-branding h1 a, .site-header .g-top-bar { border-color: ' . $header_link_color . '; } .site-header .site-branding { border-bottom-color: ' . $header_link_color . '; } ul.products li.product .star-rating span:before, ul.products li.product .star-rating:before { color: ' . $header_bg_color . '; } }'; wp_add_inline_style('g-style', $style); }
/** * Get the content background color * Accounts for the Storefront Designer's content background option. * @since 1.6.0 * @return string the backgrounc color */ function storefront_get_content_background_color() { // Set the bg color var based on whether the Storefront designer has set a content bg color or not. $content_bg_color = storefront_sanitize_hex_color(get_theme_mod('sd_content_background_color')); $content_frame = get_theme_mod('sd_fixed_width'); // Set the bg color based on the default theme option $bg_color = str_replace('#', '', get_theme_mod('background_color')); // But if the Storefront Designer extension is active, and the content frame option is enabled we need that bg color instead if ($content_bg_color && 'true' == $content_frame && class_exists('Storefront_Designer')) { $bg_color = str_replace('#', '', $content_bg_color); } return '#' . $bg_color; }
/** * Enqueue CSS and custom styles. * @since 1.0.0 * @return void */ public function spp_styles() { wp_enqueue_style('spp-styles', plugins_url('/assets/css/style.css', __FILE__)); $heading_background_color = storefront_sanitize_hex_color(get_theme_mod('spp_background_color', apply_filters('spp_default_background_color', '#ffffff'))); $spp_style = ' .storefront-single-product-pagination a { background-color: ' . $heading_background_color . '; }'; wp_add_inline_style('spp-styles', $spp_style); }