function bfg_customizer_build_styles()
 {
     if (get_theme_mod('custom-font', false)) {
         // Heading font
         $setting = 'heading-font';
         $mod = get_theme_mod($setting, customizer_library_get_default($setting));
         $stack = customizer_library_get_font_stack($mod);
         if ($mod != customizer_library_get_default($setting)) {
             Customizer_Library_Styles()->add(array('selectors' => array('.footer-widgets .widgettitle', '.widgettitle', '.h1', '.h2', '.h3', '.h4', '.h5', '.h6', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', '.widget_recent_entries li a'), 'declarations' => array('font-family' => $stack)));
         }
         // Body Font
         $setting = 'body-font';
         $mod = get_theme_mod($setting, customizer_library_get_default($setting));
         $stack = customizer_library_get_font_stack($mod);
         if ($mod != customizer_library_get_default($setting)) {
             Customizer_Library_Styles()->add(array('selectors' => array('body', '.popover', '.tooltip', '.widget_recent_entries li span', '.site-header .site-description'), 'declarations' => array('font-family' => $stack)));
         }
     }
 }
Esempio n. 2
0
 /**
  * Process user options to generate CSS needed to implement the choices.
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function customizer_library_demo_build_styles()
 {
     // Primary Color
     $setting = 'primary-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.primary'), 'declarations' => array('color' => $color)));
     }
     // Secondary Color
     $setting = 'secondary-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.secondary'), 'declarations' => array('color' => $color)));
     }
     // Border Color
     $setting = 'border';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.border'), 'declarations' => array('border-color' => $color)));
     }
     // Primary Font
     $setting = 'primary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.primary'), 'declarations' => array('font-family' => $stack)));
     }
     // Secondary Font
     $setting = 'secondary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.secondary'), 'declarations' => array('font-family' => $stack)));
     }
 }
 /**
  * Process user options to generate CSS needed to implement the choices.
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function customizer_library_squarely_build_styles()
 {
     // Primary Color
     $setting = 'header-hero';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.section-hero'), 'declarations' => array('background-image' => 'url(' . $mod . ')')));
     }
     $setting = 'brand-primary';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.primary-bg', '.btn-primary', '.icon-btn-primary', '.fbox-icon i:hover', '.fbox-icon i', '.br-primary'), 'declarations' => array('background-color' => $color, 'border-color' => $color)));
         Customizer_Library_Styles()->add(array('selectors' => array('.text-primary', '.c-primary', '.btn-primary-outline', 'icon-btn-primary-outline', '.btn-link', '.border-sm-primary', 'a', '.nav-link', '.social-icons', '.navbar-brand'), 'declarations' => array('color' => $color, 'border-color' => $color)));
     }
     // Secondary Color
     $setting = 'brand-secondary';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.secondary-bg', '.btn-secondary', '.icon-btn-secondary'), 'declarations' => array('background-color' => $color, 'border' => $color)));
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.secondary'), 'declarations' => array('color' => $color, 'border' => $color)));
     }
     // Success Color
     $setting = 'brand-success';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.success-bg', '.bg-success', '.btn-success', '.icon-btn-success'), 'declarations' => array('background-color' => $color, 'border-color' => $color)));
         Customizer_Library_Styles()->add(array('selectors' => array('.c-success', '.text-success', '.btn-success-outline', '.icon-btn-success-outline', '.success-outline'), 'declarations' => array('color' => $color, 'border-color' => $color)));
     }
     // Success Color
     $setting = 'brand-info';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.info-bg', '.bg-info', '.btn-info', '.icon-btn-info'), 'declarations' => array('background-color' => $color, 'border-color' => $color)));
         Customizer_Library_Styles()->add(array('selectors' => array('.c-info', '.text-info', '.btn-info-outline', '.icon-btn-info-outline'), 'declarations' => array('color' => $color, 'border-color' => $color)));
     }
     // Border Color
     $setting = 'body-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('body', '.c-gray'), 'declarations' => array('color' => $color)));
     }
     // Primary Font
     $setting = 'primary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'a', 'li', 'body'), 'declarations' => array('font-family' => $stack)));
     }
     // Secondary Font
     $setting = 'secondary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.script'), 'declarations' => array('font-family' => $stack)));
     }
     $setting = 'body_font_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod != customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('body'), 'declarations' => array('color' => $color)));
     }
     $setting = 'body_background';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod != customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('body'), 'declarations' => array('background-color' => $color)));
     }
     $setting = 'nav-background';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod != customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.navbar-custom'), 'declarations' => array('background-color' => $color)));
     }
 }
Esempio n. 4
0
    /**
     * Process user options to generate CSS needed to implement the choices.
     *
     * @since  1.0.0.
     *
     * @return void
     */
    function customizer_library_oceanic_build_styles()
    {
        // Main Color
        $color = 'oceanic-main-color';
        $colormod = get_theme_mod($color, customizer_library_get_default($color));
        $bgcolormod = get_theme_mod($color, customizer_library_get_default($color));
        $bghardcolormod = get_theme_mod($color, customizer_library_get_default($color));
        $bgbordercolormod = get_theme_mod($color, customizer_library_get_default($color));
        if ($colormod !== customizer_library_get_default($color)) {
            $sancolor = esc_html($colormod);
            Customizer_Library_Styles()->add(array('selectors' => array('a,
                .search-btn,
                .site-title a,
                .error-404.not-found .page-header .page-title span,
                .search-button .fa-search,
                .widget-area .widget a,
                .site-top-bar-left-text em,
                color-text'), 'declarations' => array('color' => $sancolor)));
        }
        if ($bgbordercolormod !== customizer_library_get_default($color)) {
            $sancolor = esc_html($bgbordercolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('input[type="text"]:focus,
				input[type="email"]:focus,
				input[type="url"]:focus,
				input[type="password"]:focus,
				input[type="search"]:focus,
				textarea:focus'), 'declarations' => array('border-color' => $sancolor)));
        }
        if ($bgcolormod !== customizer_library_get_default($color)) {
            $bgsancolor = esc_html($bgcolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('#comments .form-submit #submit,
                .search-block .search-submit,
                .no-results-btn,
                button,
                input[type="button"],
                input[type="reset"],
                input[type="submit"],
                .home-slider-prev:hover,
                .home-slider-next:hover,
                .woocommerce ul.products li.product a.add_to_cart_button, .woocommerce-page ul.products li.product a.add_to_cart_button,
                .woocommerce ul.products li.product .onsale, .woocommerce-page ul.products li.product .onsale,
                .woocommerce button.button.alt,
                .woocommerce-page button.button.alt,
                .woocommerce input.button.alt:hover,
                .woocommerce-page #content input.button.alt:hover,
                .woocommerce .cart-collaterals .shipping_calculator .button,
                .woocommerce-page .cart-collaterals .shipping_calculator .button,
                .woocommerce a.button,
                .woocommerce-page a.button,
                .woocommerce input.button,
                .woocommerce-page #content input.button,
                .woocommerce-page input.button,
                .woocommerce #review_form #respond .form-submit input,
                .woocommerce-page #review_form #respond .form-submit input,
                .header-cart:hover .header-cart-checkout .fa,
                .main-navigation a:hover,
                .main-navigation li.current-menu-item > a,
                .main-navigation li.current_page_item > a,
                .main-navigation li.current-menu-parent > a,
                .main-navigation li.current_page_parent > a,
                .main-navigation li.current-menu-ancestor > a,
                .main-navigation li.current_page_ancestor > a,
                .main-navigation button,
                .wpcf7-submit'), 'declarations' => array('background' => 'inherit', 'background-color' => $bgsancolor)));
        }
        if ($bghardcolormod !== customizer_library_get_default($color)) {
            $bghardsancolor = esc_html($bghardcolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('.header-cart-checkout.cart-has-items .fa-shopping-cart'), 'declarations' => array('background-color' => $bghardsancolor . ' !important')));
        }
        if ($bgbordercolormod !== customizer_library_get_default($color)) {
            $bgbordersancolor = esc_html($bgbordercolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('.woocommerce ul.products li.product .onsale:after,
                .woocommerce-page ul.products li.product .onsale:after'), 'declarations' => array('border-right' => '4px solid ' . $bgbordersancolor)));
        }
        if ($bgbordercolormod !== customizer_library_get_default($color)) {
            $bgbordersancolor = esc_html($bgbordercolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('.woocommerce .woocommerce-message'), 'declarations' => array('border-top-color' => $bgbordersancolor)));
        }
        // Main Color Hover
        $colorh = 'oceanic-main-color-hover';
        $colorhmod = get_theme_mod($colorh, customizer_library_get_default($colorh));
        $bgcolorhmod = get_theme_mod($colorh, customizer_library_get_default($colorh));
        if ($colorhmod !== customizer_library_get_default($colorh)) {
            $sancolorh = esc_html($colorhmod);
            Customizer_Library_Styles()->add(array('selectors' => array('a:hover,
                .widget-area .widget a:hover,
                .site-footer-widgets .widget a:hover,
                .site-footer-bottom-bar a:hover,
                .search-btn:hover,
                .search-button .fa-search:hover,
                .woocommerce #content div.product p.price,
                .woocommerce-page #content div.product p.price,
                .woocommerce-page div.product p.price,
                .woocommerce #content div.product span.price,
                .woocommerce div.product span.price,
                .woocommerce-page #content div.product span.price,
                .woocommerce-page div.product span.price,
                .woocommerce #content div.product .woocommerce-tabs ul.tabs li.active,
                .woocommerce div.product .woocommerce-tabs ul.tabs li.active,
                .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li.active,
                .woocommerce-page div.product .woocommerce-tabs ul.tabs li.active,
                .oceanic-header-layout-standard .site-header-right a:hover'), 'declarations' => array('color' => $sancolorh)));
        }
        if ($bgcolorhmod !== customizer_library_get_default($colorh)) {
            $bgsancolorh = esc_html($bgcolorhmod);
            Customizer_Library_Styles()->add(array('selectors' => array('.main-navigation button:hover,
                #comments .form-submit #submit:hover,
                .search-block .search-submit:hover,
                .no-results-btn:hover,
                button:hover,
                input[type="button"]:hover,
                input[type="reset"]:hover,
                input[type="submit"]:hover,
                .woocommerce input.button.alt,
                .woocommerce-page #content input.button.alt,
                .woocommerce .cart-collaterals .shipping_calculator .button,
                .woocommerce-page .cart-collaterals .shipping_calculator .button,
                .woocommerce a.button:hover,
                .woocommerce-page a.button:hover,
                .woocommerce input.button:hover,
                .woocommerce-page #content input.button:hover,
                .woocommerce-page input.button:hover,
                .woocommerce ul.products li.product a.add_to_cart_button:hover,
                .woocommerce-page ul.products li.product a.add_to_cart_button:hover,
                .woocommerce button.button.alt:hover,
                .woocommerce-page button.button.alt:hover,
                .woocommerce #review_form #respond .form-submit input:hover,
                .woocommerce-page #review_form #respond .form-submit input:hover,
                wpcf7-submit:hover'), 'declarations' => array('background' => 'inherit', 'background-color' => $bgsancolorh)));
        }
        // Body Font
        $font = 'oceanic-body-font';
        $fontmod = get_theme_mod($font, customizer_library_get_default($font));
        $fontstack = customizer_library_get_font_stack($fontmod);
        $fontcolor = 'oceanic-body-font-color';
        $fontcolormod = get_theme_mod($fontcolor, customizer_library_get_default($fontcolor));
        if ($fontmod != customizer_library_get_default($font)) {
            Customizer_Library_Styles()->add(array('selectors' => array('body,
                .site-footer-widgets .widget a,
                .site-footer-bottom-bar a'), 'declarations' => array('font-family' => $fontstack)));
        }
        if ($fontcolormod !== customizer_library_get_default($fontcolor)) {
            $sanfontcolor = esc_html($fontcolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('body,
                .site-footer-widgets .widget a,
                .site-footer-bottom-bar a'), 'declarations' => array('color' => $sanfontcolor)));
        }
        // Heading Font
        $hfont = 'oceanic-heading-font';
        $hfontmod = get_theme_mod($hfont, customizer_library_get_default($hfont));
        $hfontstack = customizer_library_get_font_stack($hfontmod);
        $hfontcolor = 'oceanic-heading-font-color';
        $hfontcolormod = get_theme_mod($hfontcolor, customizer_library_get_default($hfontcolor));
        if ($hfontmod != customizer_library_get_default($hfont)) {
            Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6,
                h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
                .woocommerce table.cart th,
                .woocommerce-page #content table.cart th,
                .woocommerce-page table.cart th,
                .woocommerce input.button.alt,
                .woocommerce-page #content input.button.alt,
                .woocommerce table.cart input,
                .woocommerce-page #content table.cart input,
                .woocommerce-page table.cart input,
                button, input[type="button"],
                input[type="reset"],
                input[type="submit"]'), 'declarations' => array('font-family' => $hfontstack)));
        }
        if ($hfontcolormod !== customizer_library_get_default($hfontcolor)) {
            $sanhfontcolor = esc_html($hfontcolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6,
                h1 a, h2 a, h3 a, h4 a, h5 a, h6 a'), 'declarations' => array('color' => $sanhfontcolor)));
        }
    }
Esempio n. 5
0
    /**
     * Process user options to generate CSS needed to implement the choices.
     *
     * @since  1.0.0.
     *
     * @return void
     */
    function customizer_library_mystore_build_styles()
    {
        // Header Background Color
        $setting = 'mystore-header-bg-color';
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        if ($mod !== customizer_library_get_default($setting)) {
            $color = sanitize_hex_color($mod);
            Customizer_Library_Styles()->add(array('selectors' => array('.site-header.mystore-header-layout-standard,
				.site-header.mystore-header-layout-standard .search-block'), 'declarations' => array('background-color' => $color)));
        }
        // Primary Color
        $setting = 'mystore-primary-color';
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        if ($mod !== customizer_library_get_default($setting)) {
            $color = sanitize_hex_color($mod);
            Customizer_Library_Styles()->add(array('selectors' => array('#comments .form-submit #submit,
                .search-block .search-submit,
                .no-results-btn,
                button,
                input[type="button"],
                input[type="reset"],
                input[type="submit"],
                .woocommerce ul.products li.product a.add_to_cart_button, .woocommerce-page ul.products li.product a.add_to_cart_button,
                .woocommerce ul.products li.product .onsale, .woocommerce-page ul.products li.product .onsale,
                .woocommerce button.button.alt,
                .woocommerce-page button.button.alt,
                .woocommerce input.button.alt:hover,
                .woocommerce-page #content input.button.alt:hover,
                .woocommerce .cart-collaterals .shipping_calculator .button,
                .woocommerce-page .cart-collaterals .shipping_calculator .button,
                .woocommerce a.button,
                .woocommerce-page a.button,
                .woocommerce input.button,
                .woocommerce-page #content input.button,
                .woocommerce-page input.button,
                .woocommerce #review_form #respond .form-submit input,
                .woocommerce-page #review_form #respond .form-submit input,
                .woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
                .single-product span.onsale,
                .main-navigation ul ul a:hover,
                .main-navigation ul ul li.current-menu-item > a,
                .main-navigation ul ul li.current_page_item > a,
                .main-navigation ul ul li.current-menu-parent > a,
                .main-navigation ul ul li.current_page_parent > a,
                .main-navigation ul ul li.current-menu-ancestor > a,
                .main-navigation ul ul li.current_page_ancestor > a,
                .main-navigation button,
                .wpcf7-submit'), 'declarations' => array('background' => 'inherit', 'background-color' => $color)));
        }
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        if ($mod !== customizer_library_get_default($setting)) {
            $color = sanitize_hex_color($mod);
            Customizer_Library_Styles()->add(array('selectors' => array('.content-area .entry-content a,
				#comments a,
				.search-btn,
				.post-edit-link,
				.site-title a,
				.error-404.not-found .page-header .page-title span,
				.search-button .fa-search,
				.header-cart-checkout.cart-has-items .fa-shopping-cart'), 'declarations' => array('color' => $color . ' !important')));
        }
        // Secondary Color
        $setting = 'mystore-secondary-color';
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        if ($mod !== customizer_library_get_default($setting)) {
            $color = sanitize_hex_color($mod);
            Customizer_Library_Styles()->add(array('selectors' => array('.main-navigation button:hover,
                #comments .form-submit #submit:hover,
                .search-block .search-submit:hover,
                .no-results-btn:hover,
                button,
                input[type="button"],
                input[type="reset"],
                input[type="submit"],
                .woocommerce input.button.alt,
                .woocommerce-page #content input.button.alt,
                .woocommerce .cart-collaterals .shipping_calculator .button,
                .woocommerce-page .cart-collaterals .shipping_calculator .button,
                .woocommerce a.button:hover,
                .woocommerce-page a.button:hover,
                .woocommerce input.button:hover,
                .woocommerce-page #content input.button:hover,
                .woocommerce-page input.button:hover,
                .woocommerce ul.products li.product a.add_to_cart_button:hover, .woocommerce-page ul.products li.product a.add_to_cart_button:hover,
                .woocommerce button.button.alt:hover,
                .woocommerce-page button.button.alt:hover,
                .woocommerce #review_form #respond .form-submit input:hover,
                .woocommerce-page #review_form #respond .form-submit input:hover,
                .woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
                .wpcf7-submit:hover'), 'declarations' => array('background' => 'inherit', 'background-color' => $color)));
        }
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        if ($mod !== customizer_library_get_default($setting)) {
            $color = sanitize_hex_color($mod);
            Customizer_Library_Styles()->add(array('selectors' => array('a:hover,
                .widget-area .widget a:hover,
                .site-footer-widgets .widget a:hover,
                .search-btn:hover,
                .search-button .fa-search:hover,
                .woocommerce #content div.product p.price,
                .woocommerce-page #content div.product p.price,
                .woocommerce-page div.product p.price,
                .woocommerce #content div.product span.price,
                .woocommerce div.product span.price,
                .woocommerce-page #content div.product span.price,
                .woocommerce-page div.product span.price,

                .woocommerce #content div.product .woocommerce-tabs ul.tabs li.active,
                .woocommerce div.product .woocommerce-tabs ul.tabs li.active,
                .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li.active,
                .woocommerce-page div.product .woocommerce-tabs ul.tabs li.active'), 'declarations' => array('color' => $color)));
        }
        // Site Border Color
        $setting = 'mystore-site-border';
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        if ($mod !== customizer_library_get_default($setting)) {
            $color = sanitize_hex_color($mod);
            Customizer_Library_Styles()->add(array('selectors' => array('.site-border-top,
				.site-border-bottom,
				.site-border-left,
				.site-border-right'), 'declarations' => array('background-color' => $color)));
        }
        // Body Font
        $setting = 'mystore-body-font';
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        $stack = customizer_library_get_font_stack($mod);
        if ($mod != customizer_library_get_default($setting)) {
            Customizer_Library_Styles()->add(array('selectors' => array('body,
				.widget-area .widget a'), 'declarations' => array('font-family' => $stack)));
        }
        // Body Font Color
        $setting = 'mystore-body-font-color';
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        if ($mod !== customizer_library_get_default($setting)) {
            $color = sanitize_hex_color($mod);
            Customizer_Library_Styles()->add(array('selectors' => array('body,
                .widget-area .widget a'), 'declarations' => array('color' => $color)));
        }
        // Heading Font
        $setting = 'mystore-heading-font';
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        $stack = customizer_library_get_font_stack($mod);
        if ($mod != customizer_library_get_default($setting)) {
            Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6,
                h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
                .widget-area .widget-title,
                .woocommerce table.cart th,
                .woocommerce-page #content table.cart th,
                .woocommerce-page table.cart th,
                .woocommerce input.button.alt,
                .woocommerce-page #content input.button.alt,
                .woocommerce table.cart input,
                .woocommerce-page #content table.cart input,
                .woocommerce-page table.cart input,
                button, input[type="button"],
                input[type="reset"],
                input[type="submit"]'), 'declarations' => array('font-family' => $stack)));
        }
        // Heading Font Color
        $setting = 'mystore-heading-font-color';
        $mod = get_theme_mod($setting, customizer_library_get_default($setting));
        if ($mod !== customizer_library_get_default($setting)) {
            $color = sanitize_hex_color($mod);
            Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6,
                h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
                .widget-area .widget-title'), 'declarations' => array('color' => $color)));
        }
    }
Esempio n. 6
0
    /**
     * Process user options to generate CSS needed to implement the choices.
     *
     * @since  1.0.0.
     *
     * @return void
     */
    function customizer_library_xcel_build_styles()
    {
        // Main Color
        $color = 'xcel-setting-main-color';
        $titlecolor = 'xcel-setting-title-color';
        $titlefontcolor = 'xcel-setting-title-font-color';
        $colormod = get_theme_mod($color, customizer_library_get_default($color));
        $titlecolormod = get_theme_mod($titlecolor, customizer_library_get_default($titlecolor));
        $titlefontcolormod = get_theme_mod($titlefontcolor, customizer_library_get_default($titlefontcolor));
        $bgcolormod = get_theme_mod($color, customizer_library_get_default($color));
        $bghardcolormod = get_theme_mod($color, customizer_library_get_default($color));
        $bgbordercolormod = get_theme_mod($color, customizer_library_get_default($color));
        if ($colormod !== customizer_library_get_default($color)) {
            $sancolor = sanitize_hex_color($colormod);
            Customizer_Library_Styles()->add(array('selectors' => array('a,
                .search-btn,
                .error-404.not-found .page-header .page-title span,
                .search-button .fa-search'), 'declarations' => array('color' => $sancolor)));
        }
        if ($bgcolormod !== customizer_library_get_default($color)) {
            $bgsancolor = sanitize_hex_color($bgcolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('#comments .form-submit #submit,
                .search-block .search-submit,
                .no-results-btn,
                button,
                input[type="button"],
                input[type="reset"],
                input[type="submit"],
                .woocommerce ul.products li.product a.add_to_cart_button, .woocommerce-page ul.products li.product a.add_to_cart_button,
                .woocommerce ul.products li.product .onsale, .woocommerce-page ul.products li.product .onsale,
                .woocommerce span.onsale,
                .woocommerce button.button.alt,
                .woocommerce-page button.button.alt,
                .woocommerce input.button.alt:hover,
                .woocommerce-page #content input.button.alt:hover,
                .woocommerce .cart-collaterals .shipping_calculator .button,
                .woocommerce-page .cart-collaterals .shipping_calculator .button,
                .woocommerce a.button,
                .woocommerce-page a.button,
                .woocommerce input.button,
                .woocommerce-page #content input.button,
                .woocommerce-page input.button,
                .woocommerce #review_form #respond .form-submit input,
                .woocommerce-page #review_form #respond .form-submit input,
                .woocommerce .site-header,
                .woocommerce-page .site-header,
                .woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
                .header-cart:hover .header-cart-checkout .fa,
                .main-navigation button,
                .wpcf7-submit'), 'declarations' => array('background' => 'inherit', 'background-color' => $bgsancolor)));
        }
        if ($titlecolormod !== customizer_library_get_default($titlecolor)) {
            $titlesancolor = sanitize_hex_color($titlecolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('.page-titlebar'), 'declarations' => array('background' => 'inherit', 'background-color' => $titlesancolor)));
        }
        if ($titlefontcolormod !== customizer_library_get_default($titlefontcolor)) {
            $titlefontsancolor = sanitize_hex_color($titlefontcolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('.page-titlebar-left .entry-title,
                .page-titlebar-right,
                .page-titlebar-right a'), 'declarations' => array('color' => $titlefontsancolor)));
        }
        if ($bghardcolormod !== customizer_library_get_default($color)) {
            $bghardsancolor = sanitize_hex_color($bghardcolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('.header-cart-checkout.cart-has-items .fa-shopping-cart'), 'declarations' => array('background-color' => $bghardsancolor . ' !important')));
        }
        if ($bgbordercolormod !== customizer_library_get_default($color)) {
            $bgbordersancolor = sanitize_hex_color($bgbordercolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('.woocommerce ul.products li.product .onsale:after,
                .woocommerce-page ul.products li.product .onsale:after'), 'declarations' => array('border-right' => '4px solid ' . $bgbordersancolor)));
        }
        // Main Color Hover
        $colorh = 'xcel-setting-main-color-hover';
        $colorhmod = get_theme_mod($colorh, customizer_library_get_default($colorh));
        $bgcolorhmod = get_theme_mod($colorh, customizer_library_get_default($colorh));
        if ($colorhmod !== customizer_library_get_default($colorh)) {
            $sancolorh = sanitize_hex_color($colorhmod);
            Customizer_Library_Styles()->add(array('selectors' => array('a:hover,
                .widget-area .widget a:hover,
                .site-footer-widgets a:hover,
                .search-btn:hover,
                .search-button .fa-search:hover,
                .woocommerce #content div.product p.price,
                .woocommerce-page #content div.product p.price,
                .woocommerce-page div.product p.price,
                .woocommerce #content div.product span.price,
                .woocommerce div.product span.price,
                .woocommerce-page #content div.product span.price,
                .woocommerce-page div.product span.price,

                .woocommerce #content div.product .woocommerce-tabs ul.tabs li.active,
                .woocommerce div.product .woocommerce-tabs ul.tabs li.active,
                .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li.active,
                .woocommerce-page div.product .woocommerce-tabs ul.tabs li.active'), 'declarations' => array('color' => $sancolorh)));
        }
        if ($bgcolorhmod !== customizer_library_get_default($colorh)) {
            $bgsancolorh = sanitize_hex_color($bgcolorhmod);
            Customizer_Library_Styles()->add(array('selectors' => array('.main-navigation button:hover,
                #comments .form-submit #submit:hover,
                .search-block .search-submit:hover,
                .no-results-btn:hover,
                button,
                input[type="button"],
                input[type="reset"],
                input[type="submit"],
                .woocommerce input.button.alt,
                .woocommerce-page #content input.button.alt,
                .woocommerce .cart-collaterals .shipping_calculator .button,
                .woocommerce-page .cart-collaterals .shipping_calculator .button,
                .woocommerce a.button:hover,
                .woocommerce-page a.button:hover,
                .woocommerce input.button:hover,
                .woocommerce-page #content input.button:hover,
                .woocommerce-page input.button:hover,
                .woocommerce ul.products li.product a.add_to_cart_button:hover, .woocommerce-page ul.products li.product a.add_to_cart_button:hover,
                .woocommerce button.button.alt:hover,
                .woocommerce-page button.button.alt:hover,
                .woocommerce #review_form #respond .form-submit input:hover,
                .woocommerce-page #review_form #respond .form-submit input:hover,
                .woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
                .wpcf7-submit:hover'), 'declarations' => array('background' => 'inherit', 'background-color' => $bgsancolorh)));
        }
        // Body Font
        $font = 'xcel-setting-body-font';
        $fontmod = get_theme_mod($font, customizer_library_get_default($font));
        $fontstack = customizer_library_get_font_stack($fontmod);
        $fontcolor = 'xcel-setting-body-font-color';
        $fontcolormod = get_theme_mod($fontcolor, customizer_library_get_default($fontcolor));
        if ($fontmod != customizer_library_get_default($font)) {
            Customizer_Library_Styles()->add(array('selectors' => array('body'), 'declarations' => array('font-family' => $fontstack)));
        }
        if ($fontcolormod !== customizer_library_get_default($fontcolor)) {
            $sanfontcolor = sanitize_hex_color($fontcolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('body,
                .widget-area .widget a,
                .site-footer-widgets a'), 'declarations' => array('color' => $sanfontcolor)));
        }
        // Heading Font
        $hfont = 'xcel-setting-heading-font';
        $hfontmod = get_theme_mod($hfont, customizer_library_get_default($hfont));
        $hfontstack = customizer_library_get_font_stack($hfontmod);
        $hfontcolor = 'xcel-setting-heading-font-color';
        $hfontcolormod = get_theme_mod($hfontcolor, customizer_library_get_default($hfontcolor));
        if ($hfontmod != customizer_library_get_default($hfont)) {
            Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6,
                h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
                .woocommerce table.cart th,
                .woocommerce-page #content table.cart th,
                .woocommerce-page table.cart th,
                .woocommerce input.button.alt,
                .woocommerce-page #content input.button.alt,
                .woocommerce table.cart input,
                .woocommerce-page #content table.cart input,
                .woocommerce-page table.cart input,
                button, input[type="button"],
                input[type="reset"],
                input[type="submit"]'), 'declarations' => array('font-family' => $hfontstack)));
        }
        if ($hfontcolormod !== customizer_library_get_default($hfontcolor)) {
            $sanhfontcolor = sanitize_hex_color($hfontcolormod);
            Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6,
                h1 a, h2 a, h3 a, h4 a, h5 a, h6 a'), 'declarations' => array('color' => $sanhfontcolor)));
        }
    }
Esempio n. 7
0
 /**
  * Process user options to generate CSS needed to implement the choices.
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function customizer_library_smtm_build_styles()
 {
     // Primary Color
     $setting = 'primary-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.primary', 'a', 'a:hover'), 'declarations' => array('color' => $color)));
         Customizer_Library_Styles()->add(array('selectors' => array('a:hover'), 'declarations' => array('opacity' => 0.8)));
     }
     // Secondary Color
     $setting = 'secondary-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.secondary'), 'declarations' => array('color' => $color)));
     }
     // header Color
     $setting = 'header-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('header.the-header'), 'declarations' => array('background-color' => $color)));
         Customizer_Library_Styles()->add(array('selectors' => array('header.the-header .widget_nav_menu a:hover, header.the-header .widget_nav_menu .current-menu-item a'), 'declarations' => array('color' => $color)));
     }
     // footer Color
     $setting = 'footer-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('footer'), 'declarations' => array('background-color' => $color)));
     }
     // Background Color
     $setting = 'background-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('body, html'), 'declarations' => array('background-color' => $color)));
     }
     // Primary Font
     $setting = 'primary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', '.widget-title', '.title'), 'declarations' => array('font-family' => $stack)));
     }
     // Secondary Font
     $setting = 'secondary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('p', 'span', 'div', 'a'), 'declarations' => array('font-family' => $stack)));
     }
     // Special Font
     $setting = 'tertiary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.widget_site_name_widget > a > h1', '.special'), 'declarations' => array('font-family' => $stack)));
     }
 }
Esempio n. 8
0
 /**
  * Process user options to generate CSS needed to implement the choices.
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function gather_styles()
 {
     // Primary Color
     $setting = 'primary-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         $color_obj = new Jetpack_Color($color);
         // Link Styling
         Customizer_Library_Styles()->add(array('selectors' => array('a', '.site-title a'), 'declarations' => array('color' => $color)));
         // Button Styling
         Customizer_Library_Styles()->add(array('selectors' => array('button', '.button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]', '.masonry .entry-footer-meta a:hover'), 'declarations' => array('background-color' => $color)));
         // Button Hover State
         Customizer_Library_Styles()->add(array('selectors' => array('button:hover', '.button:hover', 'input[type="button"]:hover', 'input[type="reset"]:hover', 'input[type="submit"]:hover'), 'declarations' => array('background-color' => $color_obj->darken(5))));
         // Border Colors
         Customizer_Library_Styles()->add(array('selectors' => array('#content blockquote', '.page-header'), 'declarations' => array('border-color' => $mod)));
     }
     // Secondary Color
     $setting = 'secondary-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         // Colors
         Customizer_Library_Styles()->add(array('selectors' => array('.site-title a:hover', '.bypostauthor .comment-author .fn:after'), 'declarations' => array('color' => sanitize_hex_color($color))));
     }
     // Primary Font
     $setting = 'primary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('body', '.site-description', '.widget-title', '.comments-title', '#reply-title'), 'declarations' => array('font-family' => $stack)));
     }
     // Secondary Font
     $setting = 'secondary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6', '.comment-author'), 'declarations' => array('font-family' => $stack)));
     }
     // Menu Styling
     $menus = array('primary', 'secondary');
     foreach ($menus as $menu) {
         if (!has_nav_menu($menu)) {
             break;
         }
         if ($menu == 'primary') {
             $selector = '#primary-navigation' . ' ';
         }
         if ($menu == 'secondary') {
             $selector = '#secondary-navigation' . ' ';
         }
         // Background
         $setting = $menu . '-menu-background';
         $mod = get_theme_mod($setting, false);
         if ($mod) {
             Customizer_Library_Styles()->add(array('selectors' => array($selector, $selector . 'ul ul a:hover'), 'declarations' => array('background-color' => $mod)));
         }
         // Background Hover
         $setting = $menu . '-menu-background-hover';
         $mod = get_theme_mod($setting, false);
         if ($mod) {
             Customizer_Library_Styles()->add(array('selectors' => array($selector . 'a:hover', $selector . 'li:hover a'), 'declarations' => array('background-color' => $mod)));
         }
         // Navigation Text
         $setting = $menu . '-menu-color';
         $mod = get_theme_mod($setting, false);
         if ($mod) {
             Customizer_Library_Styles()->add(array('selectors' => array($selector . 'a', $selector . 'a:hover', $selector . 'li:hover a', $selector . '.dropdown-toggle:after'), 'declarations' => array('color' => $mod)));
         }
         // Border
         $setting = $menu . '-menu-border';
         $mod = get_theme_mod($setting, false);
         if ($mod) {
             Customizer_Library_Styles()->add(array('selectors' => array($selector . 'ul', $selector . 'a', $selector . '.dropdown-toggle', $selector . 'ul ul', $selector . 'ul ul a', $selector . 'ul li:hover ul a', $selector . 'ul ul ul'), 'declarations' => array('border-color' => $mod)));
         }
     }
     // Header Background Color
     $setting = 'header-background-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.site-branding'), 'declarations' => array('background-color' => $mod)));
     }
     // Header Background Image
     $setting = 'header-background-image';
     $mod = get_theme_mod($setting, false);
     if ($mod) {
         Customizer_Library_Styles()->add(array('selectors' => array('.site-branding'), 'declarations' => array('background-image' => 'url(' . $mod . ')')));
     }
     // Header Background Image Styles
     $setting = 'header-background-image-style';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.site-branding'), 'declarations' => array('background-size' => 'auto auto', 'background-repeat' => 'repeat', 'background-position' => '0 0')));
     }
     // Center Header Text
     $setting = 'center-branding';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod) {
         Customizer_Library_Styles()->add(array('selectors' => array('.site-branding'), 'declarations' => array('text-align' => 'center')));
     }
     // Site Title Color
     $setting = 'site-title-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.site-title a'), 'declarations' => array('color' => $mod)));
     }
     // Site Title Color
     $setting = 'site-title-hover-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.site-title a:hover'), 'declarations' => array('color' => $mod)));
     }
     // Site Title Font
     $setting = 'site-title-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.site-title'), 'declarations' => array('font-family' => $stack)));
     }
     // Site Tagline Color
     $setting = 'site-tagline-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('.site-description'), 'declarations' => array('color' => $mod)));
     }
 }
Esempio n. 9
0
 /**
  * Process user options to generate CSS needed to implement the choices.
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function customizer_library_demo_build_styles()
 {
     // Link Hover Color
     $setting = 'link_hover_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('a:hover, a:focus, article .entry-meta a:hover, footer.entry_meta .post_details a:hover, .footer_widget a:hover,  .footer_widget a:focus, .footer_widget a.custom:hover, .footer_widget a.custom:focus, .copyright a:hover, .footer_copyright .copyright a:hover, .footer_social a:hover, .top_header_wrap .logo h3 a:hover, .top_header_wrap h1.site-title a:hover'), 'declarations' => array('color' => $color)));
     }
     // Sitewide Buttons Color
     $setting = 'button_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('button, .button, article .entry-meta .rescue_staff, .inner_content ul.pagination li.arrow a, .inner_content ul.pagination li span.current, a.tribe-events-read-more:hover, .wpcf7 input[type="submit"], .search .search-form input[type="submit"], .search .search-form input[type="submit"]:hover, #comments .rescue_staff, .widget_recent_entries span, .widget input[type="submit"], .format-quote .entry-content, .format-link .entry-content, .single-tribe_events .tribe-events-schedule .tribe-events-cost, a.tribe-events-read-more, .events-list .tribe-events-event-cost span, #tribe-bar-form .tribe-bar-submit input[type="submit"]'), 'declarations' => array('background-color' => $color)));
     }
     // Sitewide Button Hover Color
     $setting = 'main_button_hover';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('button:hover, button:focus, .button:hover, .button:focus, .wpcf7 input[type="submit"]:hover, .widget input[type="submit"]:hover, a.tribe-events-read-more:hover, #tribe-bar-form .tribe-bar-submit input[type="submit"]:hover'), 'declarations' => array('background-color' => $color)));
     }
     //  Sitewide Button Border Color
     $setting = 'link_hover_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('button, .button'), 'declarations' => array('border-color' => $color)));
     }
     // Blockquote Color
     $setting = 'link_hover_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('blockquote, .format-link'), 'declarations' => array('border-left-color' => $color)));
     }
     // Donation Button Color
     $setting = 'donate_bg_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.donation_button .button'), 'declarations' => array('background' => $color)));
     }
     // Donation Button Border Color
     $setting = 'donate_border_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.donation_button .button'), 'declarations' => array('border-color' => $color)));
     }
     // Donation Button Color Hover
     $setting = 'donate_bg_color_hover';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.donation_button .button:hover, .donation_button .button:focus'), 'declarations' => array('background' => $color)));
     }
     // Donation Button Border Color Hover
     $setting = 'donate_border_color_hover';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.donation_button .button:hover, .donation_button .button:focus'), 'declarations' => array('border-color' => $color)));
     }
     // Header Top Background Color
     $setting = 'header_top_bg_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.top_header_wrap, .top_header_wrap nav, .top_header_wrap .top-bar-section li:not(.has-form) a:not(.button), .top_header_wrap .top-bar-section .dropdown li:not(.has-form) a:not(.button), .top_header_wrap .top-bar-section ul, .top_header_wrap .top-bar.expanded .title-area'), 'declarations' => array('background' => $color)));
     }
     // Top Header Navigation Link Color
     $setting = 'header_top_nav_link_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.top_header_wrap .top_nav a'), 'declarations' => array('color' => $color)));
     }
     // Top Header Navigation Link Hover Color
     $setting = 'header_top_nav_link_color_hover';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.top-bar-section ul li:hover:not(.has-form) a:hover:not(.button)'), 'declarations' => array('color' => $color)));
     }
     // Header Bottom Background Color
     $setting = 'header_bottom_bg_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.bottom_header_wrap, .bottom_header_wrap nav, .bottom_header_wrap .top-bar-section li:not(.has-form) a:not(.button), .bottom_header_wrap .top-bar-section .dropdown li:not(.has-form) a:not(.button), .bottom_header_wrap .top-bar-section ul, .bottom_header_wrap .top-bar.expanded .title-area, .top-bar-section .dropdown li:hover:not(.has-form):not(.active) > a:not(.button), .top-bar-section li.active:not(.has-form) a:hover:not(.button)'), 'declarations' => array('background' => $color)));
     }
     // Bottom Header Navigation Link Color
     $setting = 'header_bottom_nav_link_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.bottom_header_wrap .bottom_nav a, .top-bar-section li.active:not(.has-form) a:not(.button)'), 'declarations' => array('color' => $color)));
     }
     // Header Font
     $setting = 'primary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('h1,h2,h3,h4,h5,h6,h1 a,h2 a,h3 a,h4 a,h5 a,h6 a'), 'declarations' => array('font-family' => $stack)));
     }
     // Header Font Color
     $setting = 'primary-font-color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $color = sanitize_hex_color($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6, .inner_sidebar .widget-title, .inner_sidebar .widget p .widget-title, footer.entry_meta .post_details, footer.entry_meta .share_title, .comment-respond h3'), 'declarations' => array('color' => $color)));
     }
     // Paragraph Font
     $setting = 'secondary-font';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     $stack = customizer_library_get_font_stack($mod);
     if ($mod != customizer_library_get_default($setting)) {
         Customizer_Library_Styles()->add(array('selectors' => array('body, p, blockquote, .format-link, p, pre, address, small, abbr, code, kbd, samp, small, var, form, legend, label, caption, .textwidget,.top-bar-section ul li > a, button, .button, .rescue-button span.rescue-button-inner, ol.vcalendar .duration, ol.vcalendar .vcard'), 'declarations' => array('font-family' => $stack)));
     }
     // Home Top Widgets Background Color
     $setting = 'home_top_widgets_bg';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.home_top_bg, .home_top_wrap, .inner_sidebar #mc_signup, .footer_widget #mc_signup'), 'declarations' => array('background-color' => $color)));
     }
     // Home Top Widgets Hover Color
     $setting = 'home_top_widgets_hover';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.home_widgets_top .icon_hover:hover i, .home_widgets_top .icon_hover:hover h3, .home_widgets_top .icon_hover:hover a'), 'declarations' => array('color' => $color)));
     }
     // Footer Background Color
     $setting = 'footer_bg_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('footer#site_footer'), 'declarations' => array('background-color' => $color)));
     }
     // Social Icons Color
     $setting = 'footer_social_color';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.footer_social a'), 'declarations' => array('color' => $color)));
     }
     // Social Icons Color Hover
     $setting = 'footer_social_color_hover';
     $mod = get_theme_mod($setting, customizer_library_get_default($setting));
     if ($mod !== customizer_library_get_default($setting)) {
         $color = sanitize_hex_color($mod);
         Customizer_Library_Styles()->add(array('selectors' => array('.footer_social a:hover'), 'declarations' => array('color' => $color)));
     }
 }
Esempio n. 10
0
 /**
  * Process user options to generate CSS needed to implement the choices.
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function customizer_library_kaira_build_styles()
 {
     // Main Color
     $color = 'kra-main-color';
     $colormod = get_theme_mod($color, customizer_library_get_default($color));
     $bgcolormod = get_theme_mod($color, customizer_library_get_default($color));
     $border_top_colormod = get_theme_mod($color, customizer_library_get_default($color));
     $border_right_colormod = get_theme_mod($color, customizer_library_get_default($color));
     if ($colormod !== customizer_library_get_default($color)) {
         $sancolor = sanitize_hex_color($colormod);
         Customizer_Library_Styles()->add(array('selectors' => array('a,
             .pc-text a,
             .search-block i,
             .search-no-results .page-title,
             .archive .page-title span,
             .search-results .page-title span,
             .entry-title,
             .entry-title a,
             .entry-content a,
             .entry-footer a,
             .search-button .fa-search,
             .error404 .page-title,
             .error404 .page-content .widgettitle,
             .widget ul li a,
             .main-navigation a'), 'declarations' => array('color' => $sancolor)));
     }
     if ($bgcolormod !== customizer_library_get_default($color)) {
         $bgsancolor = sanitize_hex_color($bgcolormod);
         Customizer_Library_Styles()->add(array('selectors' => array('.site-header-search .search-submit,
             .no-site-header-img .site-header-cover-image,
             .tags-links a,
             .form-submit #submit,
             .wpcf7-submit,
             .woocommerce ul.products li.product a,
             .woocommerce-page ul.products li.product a,
             .woocommerce input.button.alt:hover,
             .woocommerce-page #content input.button.alt:hover'), 'declarations' => array('background-color' => $bgsancolor . ' !important')));
     }
     if ($border_top_colormod !== customizer_library_get_default($color)) {
         $border_top_sancolor = sanitize_hex_color($border_top_colormod);
         Customizer_Library_Styles()->add(array('selectors' => array('.color-border-top,
             .nav-links a,
             aside.widget,
             .archive .page-header,
             article.page.blog-post-side-layout,
             article.post.blog-post-side-layout,
             .woocommerce #container,
             .woocommerce-page #container,
             .woocommerce-page .content-area,
             .page #content .content-area'), 'declarations' => array('border-top' => '6px solid ' . $border_top_sancolor)));
     }
     if ($border_right_colormod !== customizer_library_get_default($color)) {
         $border_right_sancolor = sanitize_hex_color($border_right_colormod);
         Customizer_Library_Styles()->add(array('selectors' => array('.tags-links a:after'), 'declarations' => array('border-right' => '12px solid ' . $border_right_sancolor)));
     }
     // Main Color Hover
     $colorh = 'kra-main-color-hover';
     $colorhmod = get_theme_mod($colorh, customizer_library_get_default($colorh));
     $bgcolorhmod = get_theme_mod($colorh, customizer_library_get_default($colorh));
     if ($colorhmod !== customizer_library_get_default($colorh)) {
         $sancolorh = sanitize_hex_color($colorhmod);
         Customizer_Library_Styles()->add(array('selectors' => array('a:hover,
             .pc-text a:hover,
             .search-block i:hover,
             .entry-content a:hover,
             .entry-footer a:hover,
             .search-button .fa-search:hover,
             .widget ul li a:hover,
             .main-navigation a:hover'), 'declarations' => array('color' => $sancolorh)));
     }
     if ($bgcolorhmod !== customizer_library_get_default($colorh)) {
         $bgsancolorh = sanitize_hex_color($bgcolorhmod);
         Customizer_Library_Styles()->add(array('selectors' => array('.form-submit #submit:hover,
             .wpcf7-submit:hover,
             .woocommerce ul.products li.product .add_to_cart_button:hover,
             .woocommerce-page ul.products li.product .add_to_cart_button:hover,
             .site-header-search .search-submit:hover,
             .woocommerce input.button.alt,
             .woocommerce-page #content input.button.alt'), 'declarations' => array('background-color' => $bgsancolorh . ' !important')));
     }
     // Body Font
     $font = 'kra-body-font';
     $fontmod = get_theme_mod($font, customizer_library_get_default($font));
     $fontstack = customizer_library_get_font_stack($fontmod);
     $fontcolor = 'kra-body-font-color';
     $fontcolormod = get_theme_mod($fontcolor, customizer_library_get_default($fontcolor));
     if ($fontmod != customizer_library_get_default($font)) {
         Customizer_Library_Styles()->add(array('selectors' => array('body,
             .page-header h1,
             .alba-banner-heading h5,
             .alba-carousel-block,
             .alba-heading-text'), 'declarations' => array('font-family' => $fontstack)));
     }
     if ($fontcolormod !== customizer_library_get_default($fontcolor)) {
         $sanfontcolor = sanitize_hex_color($fontcolormod);
         Customizer_Library_Styles()->add(array('selectors' => array('body,
             .page-header h1,
             .alba-banner-heading h5,
             .alba-carousel-block,
             .alba-heading-text'), 'declarations' => array('color' => $sanfontcolor)));
     }
     // Heading Font
     $hfont = 'kra-heading-font';
     $hfontmod = get_theme_mod($hfont, customizer_library_get_default($hfont));
     $hfontstack = customizer_library_get_font_stack($hfontmod);
     $hfontcolor = 'kra-heading-font-color';
     $hfontcolormod = get_theme_mod($hfontcolor, customizer_library_get_default($hfontcolor));
     if ($hfontmod != customizer_library_get_default($hfont)) {
         Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6,
             h1 a, h2 a, h3 a, h4 a, h5 a, h6 a'), 'declarations' => array('font-family' => $hfontstack)));
     }
     if ($hfontcolormod !== customizer_library_get_default($hfontcolor)) {
         $sanhfontcolor = sanitize_hex_color($hfontcolormod);
         Customizer_Library_Styles()->add(array('selectors' => array('h1, h2, h3, h4, h5, h6,
             h1 a, h2 a, h3 a, h4 a, h5 a, h6 a'), 'declarations' => array('color' => $sanhfontcolor)));
     }
 }