コード例 #1
0
ファイル: display.php プロジェクト: dcavins/boutique
/**
 * 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);
}
コード例 #2
0
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));
}
コード例 #3
0
ファイル: display.php プロジェクト: CannedHead/feelingsurf
/**
 * 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);
}
コード例 #4
0
        /**
         * Add CSS in <head> for styles handled by the theme customizer
         *
         * @since 1.0.0
         */
        public function add_customizer_css()
        {
            $background_color = storefront_get_content_background_color();
            $accent_color = get_theme_mod('storefront_accent_color');
            $header_background_color = get_theme_mod('storefront_header_background_color');
            $header_link_color = get_theme_mod('storefront_header_link_color');
            $header_text_color = get_theme_mod('storefront_header_text_color');
            $footer_background_color = get_theme_mod('storefront_footer_background_color');
            $footer_link_color = get_theme_mod('storefront_footer_link_color');
            $footer_heading_color = get_theme_mod('storefront_footer_heading_color');
            $footer_text_color = get_theme_mod('storefront_footer_text_color');
            $text_color = get_theme_mod('storefront_text_color');
            $heading_color = get_theme_mod('storefront_heading_color');
            $button_background_color = get_theme_mod('storefront_button_background_color');
            $button_text_color = get_theme_mod('storefront_button_text_color');
            $button_alt_background_color = get_theme_mod('storefront_button_alt_background_color');
            $button_alt_text_color = get_theme_mod('storefront_button_alt_text_color');
            $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,
		.main-navigation ul li:hover > a,
		.site-title a:hover,
		a.cart-contents:hover,
		.site-header-cart .widget_shopping_cart a:hover,
		.site-header-cart:hover > li > a {
			color: ' . storefront_adjust_color_brightness($header_link_color, 50) . ';
		}

		.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,
		.site-header {
			color: ' . $header_text_color . ';
		}

		h1, h2, h3, h4, h5, h6 {
			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 . ';
		}

		#order_review {
			background-color: ' . storefront_get_content_background_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 . ';
		}

		.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 . ';
		}

		.woocommerce-breadcrumb {
			background-color: ' . storefront_adjust_color_brightness($background_color, 7) . ';
		}

		@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);
        }
    /**
     * 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);
    }
コード例 #6
0
        /**
         * Add styles for embeds
         */
        public function print_embed_styles()
        {
            wp_enqueue_style('source-sans-pro', '//fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,300italic,400italic,700,900');
            $accent_color = get_theme_mod('storefront_accent_color');
            $background_color = storefront_get_content_background_color();
            ?>
			<style type="text/css">
				.wp-embed {
					padding: 2.618em !important;
					border: 0 !important;
					border-radius: 3px !important;
					font-family: "Source Sans Pro", "Open Sans", sans-serif !important;
					-webkit-font-smoothing: antialiased;
					background-color: <?php 
            echo storefront_adjust_color_brightness($background_color, -7);
            ?>
 !important;
				}

				.wp-embed .wp-embed-featured-image {
					margin-bottom: 2.618em;
				}

				.wp-embed .wp-embed-featured-image img,
				.wp-embed .wp-embed-featured-image.square {
					min-width: 100%;
					margin-bottom: .618em;
				}

				a.wc-embed-button {
					padding: .857em 1.387em !important;
					font-weight: 600;
					background-color: <?php 
            echo esc_attr($accent_color);
            ?>
;
					color: #fff !important;
					border: 0 !important;
					line-height: 1;
					border-radius: 0 !important;
					box-shadow:
						inset 0 -1px 0 rgba(#000,.3);
				}

				a.wc-embed-button + a.wc-embed-button {
					background-color: #60646c;
				}
			</style>
			<?php 
        }
コード例 #7
0
ファイル: display.php プロジェクト: baydiwo/RajutanIbu
    function storefront_add_customizer_css()
    {
        $accent_color = storefront_sanitize_hex_color(get_theme_mod('storefront_accent_color', apply_filters('storefront_default_accent_color', '#a46497')));
        $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', '#5a6567')));
        $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', '#a46497')));
        $footer_heading_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_heading_color', apply_filters('storefront_default_footer_heading_color', '#646c6e')));
        $footer_text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_footer_text_color', apply_filters('storefront_default_footer_text_color', '#abb1ba')));
        $text_color = storefront_sanitize_hex_color(get_theme_mod('storefront_text_color', apply_filters('storefront_default_text_color', '#787E87')));
        $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', '#787E87')));
        $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', '#a46497')));
        $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 {
			color: ' . $text_color . ';
		}

		a  {
			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 {
			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 . ';
		}

		.star-rating span:before {
			color: ' . $accent_color . ' !important;
		}

		.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);
    }
コード例 #8
0
        /**
         * Get Customizer css associated with WooCommerce.
         *
         * @see get_storefront_theme_mods()
         * @return array $woocommerce_styles the WooCommerce css
         */
        public function get_woocommerce_css()
        {
            $storefront_theme_mods = $this->get_storefront_theme_mods();
            $brighten_factor = apply_filters('storefront_brighten_factor', 25);
            $darken_factor = apply_filters('storefront_darken_factor', -25);
            $woocommerce_styles = '
			a.cart-contents,
			.site-header-cart .widget_shopping_cart a {
				color: ' . $storefront_theme_mods['header_link_color'] . ';
			}

			table.cart td.product-remove,
			table.cart td.actions {
				border-top-color: ' . $storefront_theme_mods['background_color'] . ';
			}

			.woocommerce-tabs ul.tabs li.active a,
			ul.products li.product .price,
			.onsale,
			.widget_search form:before,
			.widget_product_search form:before {
				color: ' . $storefront_theme_mods['text_color'] . ';
			}

			.woocommerce-breadcrumb a,
			a.woocommerce-review-link,
			.product_meta a {
				color: ' . storefront_adjust_color_brightness($storefront_theme_mods['text_color'], 50) . ';
			}

			.onsale {
				border-color: ' . $storefront_theme_mods['text_color'] . ';
			}

			.star-rating span:before,
			.quantity .plus, .quantity .minus,
			p.stars a:hover:after,
			p.stars a:after,
			.star-rating span:before,
			#payment .payment_methods li input[type=radio]:first-child:checked+label:before {
				color: ' . $storefront_theme_mods['accent_color'] . ';
			}

			.widget_price_filter .ui-slider .ui-slider-range,
			.widget_price_filter .ui-slider .ui-slider-handle {
				background-color: ' . $storefront_theme_mods['accent_color'] . ';
			}

			.woocommerce-breadcrumb,
			#reviews .commentlist li .comment_container {
				background-color: ' . storefront_adjust_color_brightness($storefront_theme_mods['background_color'], -7) . ';
			}

			.order_details {
				background-color: ' . storefront_adjust_color_brightness($storefront_theme_mods['background_color'], -7) . ';
			}

			.order_details li {
				border-bottom: 1px dotted ' . storefront_adjust_color_brightness($storefront_theme_mods['background_color'], -28) . ';
			}

			.order_details:before,
			.order_details:after {
				background: -webkit-linear-gradient(transparent 0,transparent 0),-webkit-linear-gradient(135deg,' . storefront_adjust_color_brightness($storefront_theme_mods['background_color'], -7) . ' 33.33%,transparent 33.33%),-webkit-linear-gradient(45deg,' . storefront_adjust_color_brightness($storefront_theme_mods['background_color'], -7) . ' 33.33%,transparent 33.33%)
			}

			@media screen and ( min-width: 768px ) {
				.site-header-cart .widget_shopping_cart,
				.site-header .product_list_widget li .quantity {
					color: ' . $storefront_theme_mods['header_text_color'] . ';
				}
			}';
            return apply_filters('storefront_customizer_woocommerce_css', $woocommerce_styles);
        }
コード例 #9
0
        /**
         * Get extension css.
         *
         * @see get_storefront_theme_mods()
         * @return array $styles the css
         */
        public function get_woocommerce_extension_css()
        {
            $storefront_customizer = new Storefront_Customizer();
            $storefront_theme_mods = $storefront_customizer->get_storefront_theme_mods();
            $woocommerce_extension_style = '';
            if ($this->is_woocommerce_extension_activated('WC_Quick_View')) {
                $woocommerce_extension_style .= '
				div.quick-view div.quick-view-image a.button {
					background-color: ' . $storefront_theme_mods['button_background_color'] . ' !important;
					border-color: ' . $storefront_theme_mods['button_background_color'] . ' !important;
					color: ' . $storefront_theme_mods['button_text_color'] . ' !important;
				}

				div.quick-view div.quick-view-image a.button:hover {
					background-color: ' . storefront_adjust_color_brightness($storefront_theme_mods['button_background_color'], $darken_factor) . ' !important;
					border-color: ' . storefront_adjust_color_brightness($storefront_theme_mods['button_background_color'], $darken_factor) . ' !important;
					color: ' . $storefront_theme_mods['button_text_color'] . ' !important;
				}';
            }
            if ($this->is_woocommerce_extension_activated('WC_Bookings')) {
                $woocommerce_extension_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: ' . $storefront_theme_mods['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:' . $storefront_theme_mods['text_color'] . ';
				}

				#wc-bookings-booking-form .wc-bookings-date-picker .ui-datepicker-header {
					background-color: ' . $storefront_theme_mods['header_background_color'] . ';
					color: ' . $storefront_theme_mods['header_text_color'] . ';
				}';
            }
            if ($this->is_woocommerce_extension_activated('WC_Product_Reviews_Pro')) {
                $woocommerce_extension_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: ' . $storefront_theme_mods['text_color'] . ' !important;
				}

				.woocommerce #reviews .contribution-actions .feedback,
				.woocommerce-page #reviews .contribution-actions .feedback,
				.star-rating-selector:not(:checked) label.checkbox {
					color: ' . $storefront_theme_mods['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: ' . $storefront_theme_mods['accent_color'] . ' !important;
				}';
            }
            if ($this->is_woocommerce_extension_activated('WC_Smart_Coupons')) {
                $woocommerce_extension_style .= '
				.coupon-container {
					background-color: ' . $storefront_theme_mods['button_background_color'] . ' !important;
				}

				.coupon-content {
					border-color: ' . $storefront_theme_mods['button_text_color'] . ' !important;
					color: ' . $storefront_theme_mods['button_text_color'] . ';
				}

				.sd-buttons-transparent.woocommerce .coupon-content,
				.sd-buttons-transparent.woocommerce-page .coupon-content {
					border-color: ' . $storefront_theme_mods['button_background_color'] . ' !important;
				}';
            }
            return apply_filters('storefront_customizer_woocommerce_extension_css', $woocommerce_extension_style);
        }