function avia_woo_dynamic_css($output, $color_set) { /*color sets*/ foreach ($color_set as $key => $colors) { $key = "." . $key; extract($colors); $constant_font = avia_backend_calc_preceived_brightness($primary, 230) ? '#ffffff' : $bg; $dark_bg2 = avia_backend_calculate_similar_color($bg2, 'darker', 1); $output .= "\n\t\t\t\n\t\t\t{$key} .cart_dropdown .dropdown_widget li a, #top {$key} .avia_cart_buttons .button, #top {$key} .dropdown_widget .buttons .button, {$key} .cart_dropdown_first .cart_dropdown_link{\n\t\t\tcolor: {$color};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .woocommerce-tabs .tabs a, {$key} .product_meta, {$key} .quantity input.qty, {$key} .cart_dropdown .dropdown_widget, {$key} .avia_select_fake_val, {$key} address, {$key} .product>a {$key} .product_excerpt, {$key} .term_description, #top {$key} .price .from, #top #wrap_all {$key} del, {$key} .dynamic-title .dynamic-heading, {$key} .dynamic-title a, {$key} .entry-summary .woocommerce-product-rating .woocommerce-review-link, {$key} .chosen-container-single .chosen-single span, #top {$key} .select2-container .select2-choice{\n\t\t\tcolor: {$meta};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} div.product .woocommerce-tabs ul.tabs li.active a, {$key} .cart_dropdown .dropdown_widget .widget_shopping_cart_content, {$key} .cart_dropdown_link, {$key} .inner_product_header, {$key} .avia-arrow, #top {$key} .variations select, #top {$key} .variations input, #top {$key} #reviews input[type='text'], {$key} #reviews .comment-text, {$key} #reviews #comment, {$key} .single-product-main-image .images a, #top {$key} .shop_table.cart .input-text, #top {$key} form.login .input-text, #top {$key} form.register .input-text, {$key} .chosen-container-single .chosen-search, {$key} .products .product-category h3:before, #top {$key} .quantity input.qty{\n\t\t\tbackground-color: {$bg};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .woocommerce-tabs .tabs .active, {$key} div.product .woocommerce-tabs .panel, {$key} .activeslideThumb, {$key} #payment li, {$key} .widget_price_filter .ui-slider-horizontal .ui-slider-range, {$key} .avia_cart, {$key} form.login, {$key} form.register, {$key} .col-1, {$key} .col-2, {$key} .variations_form, {$key} .dynamic-title, {$key} .single-product-main-image .thumbnails a , {$key} .quantity input.qty, {$key} .avia_cart_buttons, #top {$key} .dropdown_widget .buttons, div .dropdown_widget .cart_list li:hover, {$key} .woocommerce-info, #top {$key} .chosen-container-single .chosen-single, #top {$key} .chosen-search input[type='text'], {$key} .chosen-results, {$key} .chosen-container .chosen-drop, #top {$key} .select2-container .select2-choice, {$key} .widget_layered_nav_filters .chosen a:hover, {$key} .widget_layered_nav .chosen a:hover {\n\t\t\tbackground-color: {$bg2};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .thumbnail_container img, #top {$key} #main .order_details, #top {$key} .chosen-search input[type='text'], #top {$key} .chosen-container-single .chosen-single, #top {$key} .chosen-container-active .chosen-single, #top {$key} .chosen-container .chosen-drop, {$key} .chosen-container .chosen-results, {$key} .products .product-category h3:before, #top {$key} .select2-container .select2-choice{\n\t\t\tborder-color: {$border};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .summary div{\n\t\t\tborder-color: {$bg2};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .widget_price_filter .price_slider_wrapper .price_slider .ui-slider-handle, #top {$key} a.remove, #top {$key} .onsale{\n\t\t\tbackground-color: {$primary};\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} .active-result.highlighted{\n\t\t\tbackground-color: {$primary};\n\t\t\tcolor: {$constant_font};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} #shop_header a:hover{\n\t\t\tcolor: #fff;\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} .price, {$key} .stock, #top #wrap_all {$key} ins, {$key} .products .product-category h3 .count, {$key} .widget_layered_nav_filters .chosen a:before, {$key} .widget_layered_nav .chosen a:before{\n\t\t\tcolor:{$primary};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .dynamic-title a:hover{\n\t\t\tcolor:{$secondary};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .widget_price_filter .price_slider_wrapper .ui-widget-content{\n\t\t\tbackground: {$border};\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} .chzn-container-single .chzn-single{\n\t\t\tborder-color: {$border};\n\t\t\tbackground-color: {$bg2};\n\t\t\tcolor:{$meta};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} #payment {\n\t\t\tbackground-color: {$bg2};\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t#top {$key} .quantity input.plus, #top {$key} .quantity input.minus {\n\t\t\tborder-color: {$border};\n\t\t\tbackground-color: {$dark_bg2};\n\t\t\tcolor:{$meta};\n\t\t\t}\n\t\t\t\n\t\n\t\t\t"; //bookings menu $output .= "\n\t\t\t{$key} .wc-bookings-booking-form .block-picker li a, #top {$key} .wc-bookings-date-picker .ui-datepicker td{\n\t\t\tborder-color: {$border};\t\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} .wc-bookings-booking-form .block-picker li a:hover,\n\t\t\t#top {$key} .wc-bookings-booking-form .block-picker li a:focus,\n\t\t\t#top {$key} .wc-bookings-booking-form .block-picker li a.selected{\n\t\t\tbackground-color: {$primary} !important;\n\t\t\tcolor:{$constant_font} !important;\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} .wc-bookings-date-picker legend .wc-bookings-date-picker-choose-date, #top {$key} .wc-bookings-date-picker .ui-datepicker-header{\n\t\t\tborder-color: {$primary};\n\t\t\tbackground-color: {$primary};\n\t\t\tcolor:{$constant_font};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .wc-bookings-date-picker .ui-datepicker td.bookable a{\n\t\t\tbackground-color: {$primary} !important;\n\t\t\tcolor:{$constant_font} !important;\n\t\t\tborder-color: {$border};\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} .wc-bookings-date-picker .ui-datepicker th,\n\t\t\t#top {$key} .wc-bookings-date-picker .ui-datepicker td .ui-state-default{\n\t\t\tcolor:{$color};\t\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} .wc_bookings_field_start_date, #top {$key} .wc-bookings-date-picker span.label{\n\t\t\t\tcolor: {$meta};\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} .wc-bookings-booking-form .wc-bookings-booking-cost, #top {$key} .wc-bookings-date-picker .ui-datepicker td.ui-datepicker-other-month{\n\t\t\t\tbackground-color: {$bg2};\n\t\t\t}\n\t\t\t\n\t\t\t#top .wc-bookings-booking-form .blockUI.blockOverlay{\n\t\t\t\tbackground-color: {$bg} !important;\n\t\t\t}\n\t\t\t\n\t\t\t"; //sort menu $output .= "\n\t\t\t\n\t\t\t{$key} .sort-param > li > span, {$key} .sort-param > li > a, {$key} .sort-param ul{\n\t\t\tbackground-color: {$bg2};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .sort-param > li:hover > span, {$key} .sort-param > li:hover > a, {$key} .sort-param > li:hover ul, {$key} .product-sorting strong{\n\t\t\tcolor:{$heading};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .sort-param a{\n\t\t\tcolor:{$meta};\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} .sort-param a:hover{\n\t\t\tcolor:{$secondary};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .avia-bullet{\n\t\t\tborder-color: {$meta};\n\t\t\t}\n\t\t\t\n\t\t\t#top {$key} a:hover .avia-bullet{\n\t\t\tborder-color: {$secondary};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .sort-param .current-param a{\n\t\t\tcolor:{$primary};\n\t\t\t}\n\t\t\t\n\t\t\t{$key} .sort-param .current-param .avia-bullet{\n\t\t\tborder-color:{$primary};\n\t\t\t}\n\t\t\t\n\t\t\t"; if ($key == '.header_color') { $output .= "\n\t\t\t\n\t\t\t\t#top .av-cart-counter{background-color:{$primary}; color: {$constant_font};}\n\t\t\t\t\n\t\t\t\t"; } if ($key == '.main_color') { $output .= "\n\t\t\t\n\t\t\t\t.added_to_cart_notification, .added_to_cart_notification .avia-arrow{\n\t\t\t\tbackground-color: {$bg};\n\t\t\t\tcolor: {$meta};\n\t\t\t\tborder-color: {$border};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.added_to_cart_notification strong{\n\t\t\t\tcolor:{$heading};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t#top .select2-drop{ background-color: {$bg}; }\n\t\t\t\t#top .select2-results{color:{$meta};}\n\t\t\t\t#top .select2-search{ background-color: {$bg2}; }\n\t\t\t\t#top .select2-search, #top .select2-drop-active{border-color: {$border};}\n\t\t\t\t#top .select2-search input[type='text']{background-color: {$bg}; color: {$meta}; border-color: {$border};}\n\t\t\t\t.select2-results .select2-highlighted {color: {$constant_font}; background-color: {$primary}; }\n\t\t\t\t\n\t\t\t\t"; } //unset all vars with the help of variable vars :) foreach ($colors as $key => $val) { unset(${$key}); } } return $output; }
function avia_events_dynamic_css($output, $color_set) { /*color sets*/ foreach ($color_set as $key => $colors) { $key = "." . $key; extract($colors); //elements that will only appear in the main content area if ($key == ".main_color") { $constant_font = avia_backend_calc_preceived_brightness($primary, 230) ? '#ffffff' : $bg; $button_border = avia_backend_calculate_similar_color($primary, 'darker', 2); $button_border2 = avia_backend_calculate_similar_color($secondary, 'darker', 2); $bg3 = avia_backend_calculate_similar_color($bg2, 'darker', 1); $output .= "\n\t\t\t\t\n\t\t\t\t{$key} .tribe-events-single ul.tribe-related-events li, {$key} .tribe-week-grid-block div, {$key} .tribe-events-grid .tribe-grid-content-wrap .column,\n\t\t\t\t{$key} .tribe-events-loop .tribe-events-event-meta, #top {$key} .tribe-events-list-event-title.entry-title, #top {$key} .tribe-events-list-event-title,\n\t\t\t\t{$key} #tribe-events-content table.tribe-events-calendar, {$key} #tribe-events-content .tribe-events-calendar td, body .datepicker.dropdown-menu,\n\t\t\t\t#top {$key} .tribe-events-tooltip, {$key} .recurring-info-tooltip, {$key} .vevent.tribe-events-photo-event .tribe-events-photo-event-wrap,\n\t\t\t\tbody .datepicker table, body .datepicker table td, body .datepicker table th, #top #tribe-mobile-container .hentry.vevent,\n\t\t\t\t{$key} .tribe-events-venue .tribe-events-venue-meta, {$key} .tribe-mini-calendar-dayofweek, {$key} .tribe-mini-calendar td, {$key} .tribe-mini-calendar th\n\t\t\t\t{\n\t\t\t\t\tborder-color: {$border};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.single-tribe_events {$key} #tribe-events-content .tribe-events-event-meta dt, {$key} .tribe-events-list-separator-month, \n\t\t\t\t{$key} .tribe-grid-allday .hentry.vevent>div, {$key} .tribe-grid-body div[id*='tribe-events-event-'] .hentry.vevent\n\t\t\t\t{color:{$heading};}\n\t\t\t\t\n\t\t\t\t#top {$key} .tribe-week-grid-hours{color: {$color};}\n\t\t\t\t\n\t\t\t\t{$key} #tribe-events-pg-template .tribe-events-notices, {$key} #tribe-events-pg-template .tribe-events-notices strong{\n\t\t\t\t\tbackground: {$primary};\n\t\t\t\t\tcolor: {$constant_font};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t{$key} #tribe-events-bar, {$key} #tribe-events-bar:before, {$key} #tribe-events-bar:after, {$key} .tribe-grid-allday .hentry.vevent>div, {$key} .tribe-grid-body div[id*='tribe-events-event-'] .hentry.vevent, {$key} .tribe-mini-calendar-dayofweek, {$key} .tribe-mini-calendar-event .list-date{\n\t\t\t\t\tbackground: {$bg3};\n\t\t\t\t\tborder-color: {$border};\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tbody .datepicker.dropdown-menu,\n\t\t\t\t#top {$key} #tribe-bar-form input[type='text'], {$key} .tribe-mini-calendar td, {$key} .tribe-mini-calendar-event .list-date .list-dayname,\n\t\t\t\t#top {$key} .tribe-events-tooltip, {$key} .recurring-info-tooltip, {$key} .tribe-events-tooltip .tribe-events-arrow\n\t\t\t\t{\n\t\t\t\t\tbackground: {$bg};\n\t\t\t\t\tcolor: {$meta};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbody .datepicker-dropdown:after{\n\t\t\t\t\tborder-bottom-color:{$bg};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t{$key} .vevent.tribe-events-photo-event .tribe-events-photo-event-wrap, {$key} .av-tribe-events-content-wrap, {$key} .av-single-event-meta-bar-inner{\n\t\t\t\t\tbackground: {$bg2};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t{$key} .tribe-events-single ul.tribe-related-events li, {$key} .tribe-grid-allday, {$key} .tribe-week-grid-hours, {$key} .tribe-events-distance,\n\t\t\t\tbody .datepicker table tr td.day, .datepicker table tr td span, #top #wrap_all {$key} td.tribe-events-othermonth,\n\t\t\t\t{$key} .tribe-events-calendar td.tribe-events-past div[id*='tribe-events-daynum-'], {$key} .tribe-events-calendar td.tribe-events-past div[id*='tribe-events-daynum-']>a\n\t\t\t\t{\n\t\t\t\t\tbackground: {$bg2};\n\t\t\t\t\tcolor: {$meta};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t{$key} .tribe-bar-views-inner, {$key} #tribe-bar-views .tribe-bar-views-list .tribe-bar-views-option a,\n\t\t\t\t{$key} .tribe-events-calendar div[id*='tribe-events-daynum-'], {$key} .tribe-events-calendar div[id*='tribe-events-daynum-'] a\n\t\t\t\t{\n\t\t\t\t\tbackground:{$bg3};\n\t\t\t\t\tcolor: {$color};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t{$key} #tribe-events-content .tribe-events-calendar td, {$key} .tribe-week-grid-block,\n\t\t\t\t{$key} #tribe-bar-views .tribe-bar-views-list .tribe-bar-views-option a:hover{\n\t\t\t\t\tbackground:{$bg};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.single-tribe_events {$key} .tribe-events-cost, {$key} #tribe-events-content .tribe-events-calendar td, {$key} .tribe-events-adv-list-widget .tribe-events-event-cost{ \n\t\t\t\t\tcolor: {$primary}; \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbody .datepicker table tr td span:hover,\n\t\t\t\tbody .datepicker table tr td.day:hover, body .datepicker table tr td.day.focused,\n\t\t\t\t#top #wrap_all {$key} .tribe-events-button:hover{\n\t\t\t\t\tbackground-color: {$secondary};\n\t\t\t\t\tcolor:{$constant_font};\n\t\t\t\t\tborder-color:{$button_border2};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t{$key} .tribe-mini-calendar .tribe-events-has-events div[id*='daynum-'] a:before, {$key} .tribe-venue-widget-venue-name,\n\t\t\t\t{$key} .tribe-mini-calendar-nav span,\n\t\t\t\tbody .datepicker table tr td.active.active, body .datepicker table tr td span.active.active,\n\t\t\t\tbody .datepicker table tr td.active.active:hover, body .datepicker table tr td span.active.active:hover,\n\t\t\t\tbody .datepicker thead tr:first-child th:hover, body .datepicker tfoot tr th:hover,\n\t\t\t\t#top {$key} .tribe-events-tooltip h4, {$key} div.tribe-countdown-text, {$key} .tribe-mini-calendar-nav td,\n\t\t\t\t{$key} .tribe-events-calendar th, {$key} .tribe-events-grid .tribe-grid-header , {$key} .tribe-events-grid .tribe-grid-header .column,\n\t\t\t\t#top #wrap_all {$key} .tribe-events-button, {$key} .tribe-events-list .tribe-events-event-cost span,\n\t\t\t\t{$key} .tribe-events-calendar td.tribe-events-present div[id*='tribe-events-daynum-'], {$key} .tribe-events-calendar td.tribe-events-present div[id*='tribe-events-daynum-']>a\n\t\t\t\t{$key} .tribe-grid-allday .hentry.vevent>div, {$key} .tribe-grid-body div[id*='tribe-events-event-'] .hentry.vevent, {$key} .tribe-mini-calendar .tribe-events-has-events:hover a, {$key} .tribe-mini-calendar .tribe-events-has-events:hover a:hover, {$key} .tribe-mini-calendar .tribe-events-has-events.tribe-mini-calendar-today a\n\t\t\t\t{\n\t\t\t\t\tbackground-color: {$primary};\n\t\t\t\t\tcolor:{$constant_font};\n\t\t\t\t\tborder-color:{$button_border};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t{$key} #tribe-events .time-details, {$key} .single-tribe_events .tribe-events-schedule, .single-tribe_events {$key} .tribe-events-schedule h3,\n\t\t\t\t.single-tribe_events {$key} .tribe-events-event-meta dd, {$key} .recurringinfo, {$key} .tribe-mini-calendar-no-event, {$key} .tribe-mini-calendar-dayofweek,\n\t\t\t\t{$key} .tribe-mini-calendar-event .list-date .list-daynumber, {$key} .av-upcoming-event-data\n\t\t\t\t{\n\t\t\t\tcolor: {$meta};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t{$key} .tribe-mini-calendar .tribe-events-has-events div[id*='daynum-']:hover a:before{background-color: {$constant_font};}\n\t\t\t\t\n\t\t\t\t.datepicker .datepicker-switch{color:{$heading} !important;}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t@media only screen and (max-width: 768px) {\n\t\t\t\t\t{$key} .tribe-events-sub-nav li a{\n\t\t\t\t\tbackground-color: {$primary};\n\t\t\t\t\tcolor:{$constant_font};\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t#top {$key} #tribe-events-content .tribe-events-calendar td, {$key} .tribe-events-calendar td div[id*='tribe-events-daynum-'], {$key} .tribe-events-calendar td div[id*='tribe-events-daynum-']>a{background:{$bg};}\n\t\t\t\t\t#top {$key} #tribe-events-content td.tribe-events-past, #top {$key} #tribe-events-content td.tribe-events-othermonth{background:{$bg2};}\n\t\t\t\t\t#top {$key} #tribe-events-content .tribe-events-calendar td.tribe-events-present{background:{$primary};}\n\t\t\t\t\t#top {$key} #tribe-events-content td.tribe-events-has-events, #top {$key} #tribe-events-content td.tribe-events-has-events div[id*='tribe-events-daynum-'], \n\t\t\t\t\t#top {$key} #tribe-events-content td.tribe-events-has-events div[id*='tribe-events-daynum-']>a, {$key} .tribe-mobile-day-date\n\t\t\t\t\t{background:{$primary}; color: {$constant_font}; }\n\t\t\t\t\t\n\t\t\t\t\t#top {$key} .tribe-events-calendar .tribe-events-has-events:after{background: {$constant_font}; }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t@media only screen and (max-width: 768px) {\n\n\t\t\t\t{$key} .tribe-events-loop .tribe-events-event-meta, {$key} .tribe-events-list .tribe-events-venue-details{border-color: {$border}; background-color:{$bg2}; }\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t"; } //unset all vars with the help of variable vars :) foreach ($colors as $key => $val) { unset(${$key}); } } return $output; }
function avia_is_dark_bg($region, $return_only = false) { global $avia_config; $return = ""; $color = $avia_config['backend_colors']['color_set'][$region]['bg']; $is_dark = avia_backend_calc_preceived_brightness($color, 70); $return = $is_dark ? "dark_bg_color" : "light_bg_color"; if ($return_only) { return $return; } else { echo $return; } }
} //button and dropcap color white unless primary color is very very light if (avia_backend_calc_preceived_brightness($primary, 220)) { $output .= "\n\n\t\t{$key} dropcap2, {$key} dropcap3, {$key} avia_button, {$key} avia_button:hover, {$key} .on-primary-color, {$key} .on-primary-color:hover{\n\t\tcolor: {$constant_font};\n\t\t}\n\n\t\t"; } //only for certain areas switch ($key) { case '.header_color': $constant_font = avia_backend_calc_preceived_brightness($primary, 230) ? '#ffffff' : $bg; $output .= "\n\n\t\t\t#main, .html_stretched #wrap_all{\n\t\t\tbackground-color:{$bg};\n\t\t\t}\n\n\t\t\t#advanced_menu_toggle, #advanced_menu_hide{\n\t\t\tbackground-color:{$bg};\n\t\t\tcolor: {$color};\n\t\t\tborder-color: {$border};\n\t\t\t}\n\n\t\t\t.avia_desktop #advanced_menu_toggle:hover, .avia_desktop #advanced_menu_hide:hover{\n\t\t\tbackground-color: {$primary}; color: {$constant_font}; border-color:{$primary};\n\t\t\t}\n\n\t\t\t#mobile-advanced a:before {color:{$primary};}\n\t\t\t#mobile-advanced a:hover:before, #mobile-advanced span:hover a:before {color:{$constant_font};}\n\n\t\t\t"; if (isset($avia_config['backend_colors']['menu_transparent'])) { $output .= "#top {$key}.av_header_transparency{\n\t\t\tcolor: " . $avia_config['backend_colors']['menu_transparent'] . "\n\t\t\t}"; } break; case '.main_color': $constant_font = avia_backend_calc_preceived_brightness($primary, 230) ? '#ffffff' : $bg; $output .= "\n\n\t\t\t#scroll-top-link:hover{ background-color: {$bg2}; color: {$primary}; border:1px solid {$border}; }\n\n\n\t\t\t/*mobile menu*/\n\t\t\t#mobile-advanced { background-color: {$bg}; color: {$primary}; }\n\t\t\t#mobile-advanced, #mobile-advanced a, #mobile-advanced .mega_menu_title{color: {$color}; border-color:{$border}; }\n\t\t\t#mobile-advanced li > a:hover, .html_header_mobile_behavior #mobile-advanced span:hover, .html_header_mobile_behavior #mobile-advanced span:hover a{ background-color: {$primary}; color: {$constant_font}; }\n\t\t\t"; /*contact form picker*/ $output .= "\n\t\t\t.avia-datepicker-div .ui-datepicker-month, .avia-datepicker-div .ui-datepicker-year{color:{$heading};}\n\t\t\t.avia-datepicker-div{ background: {$bg}; border:1px solid {$border}; }\n\t\t\t.avia-datepicker-div a{ color:{$meta}; background-color: {$bg2}; }\n\t\t\t.avia-datepicker-div a.ui-state-active, .avia-datepicker-div a.ui-state-highlight{ color:{$primary}; }\n\t\t\t.avia-datepicker-div a.ui-state-hover{ color:{$bg2}; background-color: {$meta}; }\n\t\t\t.avia-datepicker-div .ui-datepicker-buttonpane button{ background-color: {$primary}; color: {$constant_font}; border-color: {$primary}; }\n\n\t\t\t"; break; case '.footer_color': $output .= "\n\n\t\t\t#footer .widgettitle{ color: {$meta}; }\n\n\t\t\t"; break; case '.socket_color': $output .= "\n\n\t\t\thtml, #scroll-top-link{ background-color: {$bg}; }\n\t\t\t#scroll-top-link{ color: {$color}; border:1px solid {$border}; }\n\t\t\t"; break; } //unset all vars with the help of variable vars :) foreach ($colors as $key => $val) { unset(${$key}); }
function avia_prepare_dynamic_styles($options = false) { global $avia_config; if (!$options) { $options = avia_get_option(); } $color_set = $styles = array(); $post_id = avia_get_the_ID(); $options = apply_filters('avia_pre_prepare_colors', $options); //boxed or stretched layout $avia_config['box_class'] = empty($options['color-body_style']) ? "stretched" : $options['color-body_style']; //transparency color for header menu $avia_config['backend_colors']['menu_transparent'] = empty($options['header_replacement_menu']) ? "" : $options['header_replacement_menu']; //iterate over the options array to get the color and bg image options and save them to new array foreach ($options as $key => $option) { if (strpos($key, 'colorset-') === 0) { $newkey = explode('-', $key); //add the option to the new array $color_set[$newkey[1]][$newkey[2]] = $option; } if (strpos($key, 'color-') === 0) { $newkey = explode('-', $key); //add the option to the new array $styles[$newkey[1]] = $option; } } //make sure that main color is added later than alternate color so we can nest main color elements within alternate color elements and the styling is applied. $color_set = array_reverse($color_set); ###################################################################### # optimize the styles array and set teh background image and sizing ###################################################################### /* only needed if we got a boxed layout option */ if (empty($styles['body_img'])) { $styles['body_img'] = ""; } if (empty($styles['body_repeat'])) { $styles['body_repeat'] = "no-repeat"; } if (empty($styles['body_attach'])) { $styles['body_attach'] = "fixed"; } if (empty($styles['body_pos'])) { $styles['body_pos'] = "top left"; } if ($styles['body_img'] == 'custom') { $styles['body_img'] = $styles['body_customimage']; unset($styles['body_customimage']); } if ($styles['body_repeat'] == 'fullscreen') { $styles['body_img'] = trim($styles['body_img']); if (!empty($styles['body_img'])) { $avia_config['fullscreen_image'] = $styles['body_img']; } unset($styles['body_img']); $styles['body_background'] = ""; } else { $styles['body_img'] = trim($styles['body_img']); $url = empty($styles['body_img']) ? "" : "url(" . $styles['body_img'] . ")"; $bg = empty($styles['body_color']) ? 'transparent' : $styles['body_color']; $styles['body_background'] = "{$bg} {$url} " . $styles['body_pos'] . " " . $styles['body_repeat'] . " " . $styles['body_attach']; } /* */ ###################################################################### # optimize the array to make it smaller ###################################################################### foreach ($color_set as $key => $set) { if ($color_set[$key]['bg'] == '') { $color_set[$key]['bg'] = 'transparent'; } if ($color_set[$key]['bg2'] == '') { $color_set[$key]['bg2'] = 'transparent'; } if ($color_set[$key]['primary'] == '') { $color_set[$key]['primary'] = 'transparent'; } if ($color_set[$key]['secondary'] == '') { $color_set[$key]['secondary'] = 'transparent'; } if ($color_set[$key]['color'] == '') { $color_set[$key]['color'] = 'transparent'; } if ($color_set[$key]['border'] == '') { $color_set[$key]['border'] = 'transparent'; } if ($color_set[$key]['img'] == 'custom') { $color_set[$key]['img'] = $color_set[$key]['customimage']; unset($color_set[$key]['customimage']); } if ($color_set[$key]['img'] == '') { unset($color_set[$key]['img'], $color_set[$key]['pos'], $color_set[$key]['repeat'], $color_set[$key]['attach']); } else { $bg = empty($color_set[$key]['bg']) ? 'transparent' : $color_set[$key]['bg']; $repeat = $color_set[$key]['repeat'] == "fullscreen" ? "no-repeat" : $color_set[$key]['repeat']; $color_set[$key]['img'] = trim($color_set[$key]['img']); $url = empty($color_set[$key]['img']) ? "" : "url(" . $color_set[$key]['img'] . ")"; $color_set[$key]['background_image'] = "{$bg} {$url} " . $color_set[$key]['pos'] . " " . $repeat . " " . $color_set[$key]['attach']; } if (isset($color_set[$key]['customimage'])) { unset($color_set[$key]['customimage']); } //checks if we have a dark or light background and then creates a stronger version of the main font color for headings $shade = avia_backend_calc_preceived_brightness($color_set[$key]['bg'], 100) ? 'lighter' : 'darker'; $color_set[$key]['heading'] = avia_backend_calculate_similar_color($color_set[$key]['color'], $shade, 4); // creates a new color from the background color and the heading color (results in a lighter color) $color_set[$key]['meta'] = avia_backend_merge_colors($color_set[$key]['heading'], $color_set[$key]['bg']); } $avia_config['backend_colors']['color_set'] = $color_set; $avia_config['backend_colors']['style'] = $styles; require AVIA_BASE . 'css/dynamic-css.php'; }