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_woo_dynamic_css($output, $color_set) { /*color sets*/ foreach ($color_set as $key => $colors) { $key = "." . $key; extract($colors); $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{\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{\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{\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 {\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_layered_nav ul li.chosen, {$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{$key} #shop_header a:hover, #top {$key} .widget_layered_nav ul li.chosen a, #top {$key} .widget_layered_nav ul li.chosen small{\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{\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"; //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 == '.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"; } //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; }
$output .= "\n{$key} .avia-icon-list .iconlist_icon{\nbackground-color:{$iconlist};\n}\n\n{$key} .avia-icon-list .iconlist-timeline{\nborder-color:{$border};\n}\n\n{$key} .iconlist_content{\ncolor:{$meta};\n}\n\n"; // form fields $output .= "\n\n#top {$key} .input-text, #top {$key} input[type='text'], #top {$key} input[type='input'], #top {$key} input[type='password'], #top {$key} input[type='email'], #top {$key} input[type='number'], #top {$key} input[type='url'], #top {$key} input[type='tel'], #top {$key} input[type='search'], #top {$key} textarea, #top {$key} select{\nborder-color:{$border};\nbackground-color: {$bg2};\ncolor:{$meta};\n}\n\n#top {$key} .invers-color .input-text, #top {$key} .invers-color input[type='text'], #top {$key} .invers-color input[type='input'], #top {$key} .invers-color input[type='password'], #top {$key} .invers-color input[type='email'], #top {$key} .invers-color input[type='number'], #top {$key} .invers-color input[type='url'], #top {$key} .invers-color input[type='tel'], #top {$key} .invers-color input[type='search'], #top {$key} .invers-color textarea, #top {$key} .invers-color select{\nbackground-color: {$bg};\n}\n\n{$key} .required{\ncolor:{$primary};\n}\n\n\n"; // masonry $masonry = avia_backend_calculate_similar_color($bg2, 'darker', 1); $output .= "\n\n{$key} .av-masonry{\n\tbackground-color: {$masonry};\n }\n\n{$key} .av-inner-masonry-content{\n\n}\n\n{$key} .av-masonry-pagination, {$key} .av-masonry-pagination:hover{\n\tbackground-color: {$bg};\n}\n\n"; // hr shortcode $output .= "\n\n {$key} .hr-short .hr-inner-style, {$key} .hr-short .hr-inner{\n\nbackground-color: {$bg};\n}\n\n"; //sidebar tab & Tabs shortcode $output .= "\ndiv {$key} .tabcontainer .active_tab_content, div {$key} .tabcontainer .active_tab{\nbackground-color: {$bg2};\ncolor:{$color};\n}\n\n{$key} .template-archives .tabcontainer a, #top {$key} .tabcontainer .tab:hover{\ncolor:{$color};\n}\n\n {$key} .template-archives .tabcontainer a:hover{\ncolor:{$secondary};\n}\n\n\n{$key} .sidebar_tab_icon {\nbackground-color: {$border};\n}\n\n#top {$key} .sidebar_active_tab .sidebar_tab_icon {\nbackground-color: {$primary};\n}\n\n{$key} .sidebar_tab:hover .sidebar_tab_icon {\nbackground-color: {$secondary};\n}\n\n{$key} .sidebar_tab, {$key} .tabcontainer .tab{\ncolor: {$meta};\n}\n\n{$key} div .sidebar_active_tab , div {$key} .tabcontainer.noborder_tabs .active_tab_content, div {$key} .tabcontainer.noborder_tabs .active_tab{\ncolor: {$color};\nbackground-color: {$bg};\n}\n\n#top .avia-smallarrow-slider .avia-slideshow-dots a{\nbackground-color: {$bg2};\n}\n\n#top {$key} .avia-smallarrow-slider .avia-slideshow-dots a.active, #top {$key} .avia-smallarrow-slider .avia-slideshow-dots a:hover{\nbackground-color: {$meta};\n}\n\n\n@media only screen and (max-width: 767px) {\n\t.responsive #top {$key} .tabcontainer .active_tab{ background-color: {$secondary}; color:{$constant_font}; } /*hard coded white to match the icons beside which are also white*/\n\t.responsive #top {$key} .tabcontainer{border-color:{$border};}\n\t.responsive #top {$key} .active_tab_content{background-color: {$bg2};}\n}\n\n"; //pricing table $stripe = avia_backend_calculate_similar_color($primary, 'lighter', 2); $stripe2 = avia_backend_calculate_similar_color($primary, 'lighter', 1); $output .= "\n{$key} tr:nth-child(even), {$key} .avia-data-table .avia-heading-row .avia-desc-col, {$key} .avia-data-table .avia-highlight-col, {$key} .pricing-table>li:nth-child(even), body {$key} .pricing-table.avia-desc-col li{\nbackground-color:{$bg};\ncolor: {$color};\n}\n\n{$key} table caption, {$key} tr:nth-child(even), {$key} .pricing-table>li:nth-child(even){\ncolor: {$meta};\n}\n\n{$key} tr:nth-child(odd), {$key} .pricing-table>li:nth-child(odd), {$key} .pricing-extra{\nbackground: {$bg2};\n}\n\n{$key} .pricing-table li.avia-pricing-row, {$key} .pricing-table li.avia-heading-row, {$key} .pricing-table li.avia-pricing-row .pricing-extra{\nbackground-color: {$primary};\ncolor:{$constant_font};\nborder-color:{$stripe};\n}\n\n{$key} .pricing-table li.avia-heading-row, {$key} .pricing-table li.avia-heading-row .pricing-extra{\nbackground-color: {$stripe2};\ncolor:{$constant_font};\nborder-color:{$stripe};\n}\n\n{$key} .pricing-table.avia-desc-col .avia-heading-row, {$key} .pricing-table.avia-desc-col .avia-pricing-row{\nborder-color:{$border};\n}\n\n"; //media player + progress bar shortcode $stripe = avia_backend_calculate_similar_color($primary, 'lighter', 2); $output .= "\n{$key} .mejs-controls .mejs-time-rail .mejs-time-current, {$key} .mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current, {$key} .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current, {$key} .theme-color-bar .bar {\n\nbackground: {$primary};\nbackground-image:\t-webkit-linear-gradient(-45deg, {$primary} 25%, {$stripe} 25%, {$stripe} 50%, {$primary} 50%, {$primary} 75%, {$stripe} 75%, {$stripe});\nbackground-image: -moz-linear-gradient(-45deg, {$primary} 25%, {$stripe} 25%, {$stripe} 50%, {$primary} 50%, {$primary} 75%, {$stripe} 75%, {$stripe});\nbackground-image: linear-gradient(-45deg, {$primary} 25%, {$stripe} 25%, {$stripe} 50%, {$primary} 50%, {$primary} 75%, {$stripe} 75%, {$stripe});\nbackground-size: 6px 6px;\n}\n\n{$key} .mejs-controls .mejs-time-rail .mejs-time-float {\nbackground: {$primary};\nbackground: -webkit-linear-gradient({$stripe}, {$primary});\nbackground: -moz-linear-gradient({$stripe}, {$primary});\nbackground: linear-gradient({$stripe}, {$primary});\ncolor: #fff;\n}\n\n{$key} .mejs-controls .mejs-time-rail .mejs-time-float-corner {\nborder: solid 4px {$primary};\nborder-color: {$primary} transparent transparent transparent;\n}\n\n\n{$key} .progress{\nbackground-color:{$bg2};\n}\n\n"; /*forum*/ $output .= "\n\n{$key} span.bbp-admin-links a{\ncolor: {$primary};\n}\n\n{$key} span.bbp-admin-links a:hover{\ncolor: {$secondary};\n}\n\n#top {$key} .bbp-reply-content, #top {$key} .bbp-topic-content, #top {$key} .bbp-body .super-sticky .page-numbers, #top {$key} .bbp-body .sticky .page-numbers, #top {$key} .bbp-pagination-links a:hover, #top {$key} .bbp-pagination-links span.current{ background:{$bg}; }\n\n#top {$key} .bbp-topics .bbp-header, #top {$key} .bbp-topics .bbp-header, #top {$key} .bbp-forums .bbp-header, #top {$key} .bbp-topics-front ul.super-sticky, #top {$key} .bbp-topics ul.super-sticky, #top {$key} .bbp-topics ul.sticky, #top {$key} .bbp-forum-content ul.sticky, #top {$key} .bbp-body .page-numbers{\nbackground-color:{$bg2};\n}\n\n#top {$key} .bbp-meta, #top {$key} .bbp-author-role, #top {$key} .bbp-author-ip, #top {$key} .bbp-pagination-count, #top {$key} .bbp-topics .bbp-body .bbp-topic-title:before{\ncolor: {$meta};\n}\n\n#top {$key} .bbp-admin-links{\ncolor:{$border};\n}\n\n{$key} #bbpress-forums li.bbp-body ul.forum, {$key} #bbpress-forums li.bbp-body ul.topic,\n.avia_transform {$key} .bbp-replies .bbp-reply-author:before, \n.avia_transform .forum-search {$key} .bbp-reply-author:before,\n.avia_transform .forum-search {$key} .bbp-topic-author:before{\nbackground-color:{$bg};\nborder-color:{$border};\n}\n\n#top {$key} .bbp-author-name{\ncolor:{$heading};\n}\n\n{$key} .widget_display_stats dt, {$key} .widget_display_stats dd{\nbackground-color:{$bg2};\n}\n\n"; //apply background image if available if (isset($background_image)) { $output .= "{$key} { background: {$background_image}; }\n\t\t"; } //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;
// masonry $masonry = avia_backend_calculate_similar_color($bg2, 'darker', 1); $output .= "\n\n{$key} .av-masonry{\n\tbackground-color: {$masonry};\n }\n\n{$key} .av-inner-masonry-content{\n\n}\n\n{$key} .av-masonry-pagination, {$key} .av-masonry-pagination:hover{\n\tbackground-color: {$bg};\n}\n\n\n{$key} .container .av-inner-masonry-content, #top {$key} .container .av-masonry-load-more, #top {$key} .container .av-masonry-sort, {$key} .container .av-masonry-entry .avia-arrow{\n\tbackground-color: {$bg2};\n}\n\n"; // hr shortcode $output .= "\n\n {$key} .hr-short .hr-inner-style, {$key} .hr-short .hr-inner{\n\nbackground-color: {$bg};\n}\n\n"; //sidebar tab & Tabs shortcode $output .= "\ndiv {$key} .tabcontainer .active_tab_content, div {$key} .tabcontainer .active_tab{\nbackground-color: {$bg2};\ncolor:{$color};\n}\n\n.responsive.js_active #top {$key} .avia_combo_widget .top_tab .tab{\nborder-top-color:{$border};\n}\n\n\n{$key} .template-archives .tabcontainer a, #top {$key} .tabcontainer .tab:hover, #top {$key} .tabcontainer .tab.active_tab{\ncolor:{$color};\n}\n\n {$key} .template-archives .tabcontainer a:hover{\ncolor:{$secondary};\n}\n\n\n{$key} .sidebar_tab_icon {\nbackground-color: {$border};\n}\n\n#top {$key} .sidebar_active_tab .sidebar_tab_icon {\nbackground-color: {$primary};\n}\n\n{$key} .sidebar_tab:hover .sidebar_tab_icon {\nbackground-color: {$secondary};\n}\n\n{$key} .sidebar_tab, {$key} .tabcontainer .tab{\ncolor: {$meta};\n}\n\n{$key} div .sidebar_active_tab , div {$key} .tabcontainer.noborder_tabs .active_tab_content, div {$key} .tabcontainer.noborder_tabs .active_tab{\ncolor: {$color};\nbackground-color: {$bg};\n}\n\n#top .avia-smallarrow-slider .avia-slideshow-dots a{\nbackground-color: {$bg2};\n}\n\n#top {$key} .avia-smallarrow-slider .avia-slideshow-dots a.active, #top {$key} .avia-smallarrow-slider .avia-slideshow-dots a:hover{\nbackground-color: {$meta};\n}\n\n\n@media only screen and (max-width: 767px) {\n\t.responsive #top {$key} .tabcontainer .active_tab{ background-color: {$secondary}; color:{$constant_font}; } /*hard coded white to match the icons beside which are also white*/\n\t.responsive #top {$key} .tabcontainer{border-color:{$border};}\n\t.responsive #top {$key} .active_tab_content{background-color: {$bg2};}\n}\n\n"; //pricing table $stripe = avia_backend_calculate_similar_color($primary, 'lighter', 2); $stripe2 = avia_backend_calculate_similar_color($primary, 'lighter', 1); $output .= "\n{$key} tr:nth-child(even), {$key} .avia-data-table .avia-heading-row .avia-desc-col, {$key} .avia-data-table .avia-highlight-col, {$key} .pricing-table>li:nth-child(even), body {$key} .pricing-table.avia-desc-col li{\nbackground-color:{$bg};\ncolor: {$color};\n}\n\n{$key} table caption, {$key} tr:nth-child(even), {$key} .pricing-table>li:nth-child(even){\ncolor: {$meta};\n}\n\n{$key} tr:nth-child(odd), {$key} .pricing-table>li:nth-child(odd), {$key} .pricing-extra{\nbackground: {$bg2};\n}\n\n{$key} .pricing-table li.avia-pricing-row, {$key} .pricing-table li.avia-heading-row, {$key} .pricing-table li.avia-pricing-row .pricing-extra{\nbackground-color: {$primary};\ncolor:{$constant_font};\nborder-color:{$stripe};\n}\n\n{$key} .pricing-table li.avia-heading-row, {$key} .pricing-table li.avia-heading-row .pricing-extra{\nbackground-color: {$stripe2};\ncolor:{$constant_font};\nborder-color:{$stripe};\n}\n\n{$key} .pricing-table.avia-desc-col .avia-heading-row, {$key} .pricing-table.avia-desc-col .avia-pricing-row{\nborder-color:{$border};\n}\n\n"; //media player + progress bar shortcode $stripe = avia_backend_calculate_similar_color($primary, 'lighter', 2); $output .= "\n{$key} .theme-color-bar .bar{\nbackground: {$primary};\n}\n\n\n\n{$key} .mejs-controls .mejs-time-rail .mejs-time-current, {$key} .mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current, {$key} .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current, {$key} .button.av-sending-button, {$key} .av-striped-bar .theme-color-bar .bar{\n\nbackground: {$primary};\nbackground-image:\t-webkit-linear-gradient(-45deg, {$primary} 25%, {$stripe} 25%, {$stripe} 50%, {$primary} 50%, {$primary} 75%, {$stripe} 75%, {$stripe});\nbackground-image: -moz-linear-gradient(-45deg, {$primary} 25%, {$stripe} 25%, {$stripe} 50%, {$primary} 50%, {$primary} 75%, {$stripe} 75%, {$stripe});\nbackground-image: linear-gradient(-45deg, {$primary} 25%, {$stripe} 25%, {$stripe} 50%, {$primary} 50%, {$primary} 75%, {$stripe} 75%, {$stripe});\nbackground-size: 10px 10px;\n}\n\nbody {$key} .mejs-controls .mejs-time-rail .mejs-time-float {\nbackground: {$primary};\nbackground: -webkit-linear-gradient({$stripe}, {$primary});\nbackground: -moz-linear-gradient({$stripe}, {$primary});\nbackground: linear-gradient({$stripe}, {$primary});\ncolor: #fff;\n}\n\nbody {$key} .mejs-controls .mejs-time-rail .mejs-time-float-corner {\nborder: solid 4px {$primary};\nborder-color: {$primary} transparent transparent transparent;\n}\n\n\n{$key} .progress{\nbackground-color:{$bg2};\n}\n\n"; /*contact form send button*/ $stripe2nd = avia_backend_calculate_similar_color($secondary, 'lighter', 1); $output .= " {$key} .button.av-sending-button{\nbackground: {$secondary};\nbackground-image:\t-webkit-linear-gradient(-45deg, {$secondary} 25%, {$stripe2nd} 25%, {$stripe2nd} 50%, {$secondary} 50%, {$secondary} 75%, {$stripe2nd} 75%, {$stripe2nd});\nbackground-image: -moz-linear-gradient(-45deg, {$secondary} 25%, {$stripe2nd} 25%, {$stripe2nd} 50%, {$secondary} 50%, {$secondary} 75%, {$stripe2nd} 75%, {$stripe2nd});\nbackground-image: linear-gradient(-45deg, {$secondary} 25%, {$stripe2nd} 25%, {$stripe2nd} 50%, {$secondary} 50%, {$secondary} 75%, {$stripe2nd} 75%, {$stripe2nd});\nborder-color:{$secondary};\n}"; /*forum*/ $output .= "\n\n{$key} span.bbp-admin-links a{\ncolor: {$primary};\n}\n\n{$key} span.bbp-admin-links a:hover{\ncolor: {$secondary};\n}\n\n#top {$key} .bbp-reply-content, #top {$key} .bbp-topic-content, #top {$key} .bbp-body .super-sticky .page-numbers, #top {$key} .bbp-body .sticky .page-numbers, #top {$key} .bbp-pagination-links a:hover, #top {$key} .bbp-pagination-links span.current{ background:{$bg}; }\n\n#top {$key} .bbp-topics .bbp-header, #top {$key} .bbp-topics .bbp-header, #top {$key} .bbp-forums .bbp-header, #top {$key} .bbp-topics-front ul.super-sticky, #top {$key} .bbp-topics ul.super-sticky, #top {$key} .bbp-topics ul.sticky, #top {$key} .bbp-forum-content ul.sticky, #top {$key} .bbp-body .page-numbers{\nbackground-color:{$bg2};\n}\n\n#top {$key} .bbp-meta, #top {$key} .bbp-author-role, #top {$key} .bbp-author-ip, #top {$key} .bbp-pagination-count, #top {$key} .bbp-topics .bbp-body .bbp-topic-title:before{\ncolor: {$meta};\n}\n\n#top {$key} .bbp-admin-links{\ncolor:{$border};\n}\n\n{$key} #bbpress-forums li.bbp-body ul.forum, {$key} #bbpress-forums li.bbp-body ul.topic,\n.avia_transform {$key} .bbp-replies .bbp-reply-author:before, \n.avia_transform .forum-search {$key} .bbp-reply-author:before,\n.avia_transform .forum-search {$key} .bbp-topic-author:before{\nbackground-color:{$bg};\nborder-color:{$border};\n}\n\n#top {$key} .bbp-author-name{\ncolor:{$heading};\n}\n\n{$key} .widget_display_stats dt, {$key} .widget_display_stats dd{\nbackground-color:{$bg2};\n}\n\n"; //apply background image if available if (isset($background_image)) { $output .= "{$key} { background: {$background_image}; }\n\t\t"; } //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;
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'; }
<?php global $avia_config; $primary = avia_get_option('primary'); $primary_font = avia_get_option('header_font'); $secondary = avia_get_option('secondary'); $header = avia_get_option('header_bg'); $header_dark = avia_backend_calculate_similar_color($header, 'darker', 1); //calculates a second color for hover effects based on the primary color choosen in the backend $modify = 2; if (avia_get_option('stylesheet') == 'dark-skin.css') { $modify = 5; } $primary_addapted = avia_backend_calculate_similar_color($primary, 'lighter', $modify); $secondary_addapted = avia_backend_calculate_similar_color($secondary, 'darker', $modify); $avia_config['style'] = array(array('elements' => '::-moz-selection', 'key' => 'background-color', 'value' => $primary), array('elements' => '::-webkit-selection', 'key' => 'background-color', 'value' => $primary), array('elements' => '::selection', 'key' => 'background-color', 'value' => $primary), array('elements' => '::-moz-selection', 'key' => 'color', 'value' => $primary_font), array('elements' => '::-webkit-selection', 'key' => 'color', 'value' => $primary_font), array('elements' => '::selection', 'key' => 'color', 'value' => $primary_font), array('elements' => '.button, #submit, .dropcap2, #header, #footer, #socket, div #footer h1, div #footer h2, div #footer h3, div #footer h4, div #footer h5, div #footer h6 ,div #footer h1 a,div #footer h2 a, div #footer h3 a, div #footer h4 a, div #footer h5 a, div #footer h6 a, #top .sub_menu a, a.button , .button a:hover, .button:hover, div .widget_layered_nav ul li.chosen a, .widget_layered_nav ul .chosen small.count, #main table th, div .quantity input.minus:hover, div .quantity input.plus:hover', 'key' => 'color', 'value' => $primary_font), array('elements' => '#header, #footer, .dropcap2, div .callout .big_button, #top .main_menu .avia_mega ul ul li, #top .main_menu .avia_mega >li >ul li, .thumbnail_container:hover, div .widget_layered_nav ul li.chosen, #main table th, div .quantity input.minus:hover, div .quantity input.plus:hover, a.remove:hover', 'key' => 'background-color', 'value' => $header), array('elements' => '#socket, div .callout .big_button:hover', 'key' => 'background-color', 'value' => $header_dark), array('elements' => 'div .callout .big_button', 'key' => 'border-color', 'value' => $header), array('elements' => 'a, h4.teaser_text, .entry-content h1, .entry-content h2, #top .pagination a:hover, #top .tweets a', 'key' => 'color', 'value' => $primary), array('elements' => '#top #footer, #top #footer span, #top #footer div, #top #footer p, #top #footer a, #top #socket a', 'key' => 'color', 'value' => $primary_font), array('elements' => '#top #footer, #top #footer span, #top #footer div, #top #footer p, #top #footer a', 'key' => 'background-color', 'value' => $header), array('elements' => '#top #footer a, #top #socket a, #footer .widget_archive ul, #footer .widget_categories ul, #footer .widget_pages ul, #footer .widget_links ul, #footer .widget_meta ul, #footer .widget_nav_menu ul, #top .sub_menu li', 'key' => 'border-color', 'value' => avia_backend_calculate_similar_color($header, 'lighter', 2)), array('elements' => '#top .button, #top #submit', 'key' => 'background-color', 'value' => $primary), array('elements' => '#top .button:hover, #top #submit:hover', 'key' => 'background-color', 'value' => $secondary), array('elements' => 'a:hover, .widget .news-link:hover, #top .main_menu .menu .current-menu-item a strong', 'key' => 'color', 'value' => $secondary), array('key' => 'direct_input', 'value' => avia_get_option('quick_css')), array('elements' => '.cufon_headings', 'key' => 'cufon', 'value' => avia_get_option('font_heading'))); $avia_config['style'][] = array('elements' => 'html, body', 'key' => 'background-color', 'value' => avia_get_option('bg_color')); if ($header == avia_get_option('bg_color')) { $avia_config['style'][] = array('elements' => '#top #footer, #top #footer span, #top #footer div, #top #footer p, #top #footer a', 'key' => 'background-color', 'value' => avia_backend_calculate_similar_color($header, 'lighter', 1)); } if (avia_get_option('bg_image') != '') { $avia_config['style'][] = array('elements' => '#header', 'key' => 'background-color', 'value' => avia_get_option('bg_image_header_active')); if (avia_get_option('bg_image_repeat') != 'fullscreen') { $avia_config['style'][] = array('elements' => 'html, body', 'key' => 'backgroundImage', 'value' => avia_get_option('bg_image')); $avia_config['style'][] = array('elements' => 'html, body', 'key' => 'background-position', 'value' => 'top ' . avia_get_option('bg_image_position')); $avia_config['style'][] = array('elements' => 'html, body', 'key' => 'background-repeat', 'value' => avia_get_option('bg_image_repeat')); $avia_config['style'][] = array('elements' => 'html, body', 'key' => 'background-attachment', 'value' => avia_get_option('bg_image_attachment')); } }