= 8) $rm = (int)(.7 * $r); else $rm = $r; } if (aspen_getopt('rounded_corners')) { // not #access3 aspen_f_write($sout, sprintf("#wrapper, #branding, #colophon, .commentlist li.comment, #respond, #primary-widget-area,#right-widget-area,#left-widget-area,.sidebar_top,.sidebar_bottom,.sidebar_extra,#first,#second,#third,#fourth,.mobile_widget_area {-moz-border-radius: %dpx; -webkit-border-radius: %dpx; border-radius: %dpx;}\n",$r,$r,$r)); aspen_f_write($sout, sprintf("#sidebar_wrap_right.right-1-col,#sidebar_wrap_right.right-2-col,#sidebar_wrap_right.right-2-col-bottom, #sidebar_wrap_left.left-1-col,#sidebar_wrap_left.left-2-col,#sidebar_wrap_left.left-2-col-bottom,#sidebar_wrap_left,#sidebar_wrap_right {-moz-border-radius: %dpx; -webkit-border-radius: %dpx; border-radius: %dpx;}\n",$r,$r,$r)); aspen_f_write($sout, sprintf(".commentlist li.comment .comment-meta {-moz-border-radius-topleft: %dpx; -moz-border-radius-topright: %dpx; -webkit-border-top-left-radius: %dpx; -webkit-border-top-right-radius: %dpx; border-top-left-radius: %dpx; border-top-right-radius: %dpx;}\n", $rm,$rm,$rm,$rm,$rm,$rm)); if (aspen_getopt('move_menu')) { aspen_f_write($sout, sprintf("#access2 {-moz-border-radius-bottomleft: %dpx; -moz-border-radius-bottomright: %dpx; -webkit-border-bottom-left-radius: %dpx; -webkit-border-bottom-right-radius: %dpx; border-bottom-left-radius: %dpx; border-bottom-right-radius: %dpx;}\n", $rm,$rm,$rm,$rm,$rm,$rm)); aspen_f_write($sout, sprintf("#access {-moz-border-radius-topleft: %dpx; -moz-border-radius-topright: %dpx; -webkit-border-top-left-radius: %dpx; -webkit-border-top-right-radius: %dpx; border-top-left-radius: %dpx; border-top-right-radius: %dpx;}\n", $rm,$rm,$rm,$rm,$rm,$rm)); } else { aspen_f_write($sout, sprintf("#access {-moz-border-radius-bottomleft: %dpx; -moz-border-radius-bottomright: %dpx; -webkit-border-bottom-left-radius: %dpx; -webkit-border-bottom-right-radius: %dpx;border-bottom-left-radius: %dpx; border-bottom-right-radius: %dpx;}\n", $rm,$rm,$rm,$rm,$rm,$rm)); aspen_f_write($sout, sprintf("#access2 {-moz-border-radius-topleft: %dpx; -moz-border-radius-topright: %dpx; -webkit-border-top-left-radius: %dpx; -webkit-border-top-right-radius: %dpx;border-top-left-radius: %dpx; border-top-right-radius: %dpx;}\n", $rm,$rm,$rm,$rm,$rm,$rm)); } } if (aspen_getopt('rounded_corners_content')) { // content area, too aspen_f_write($sout, sprintf("#content, #content .post{-moz-border-radius: %dpx; -webkit-border-radius: %dpx; border-radius: %dpx;}\n",$r,$r,$r)); } /* fadebody_bg */ if (aspen_getopt('fadebody_bg')) { aspen_f_write($sout, sprintf("body {background-image: url(%s); background-attachment: scroll; background-repeat: repeat-x;}\n", aspen_relative_url('images/gr.png'))); } /* wrap_shadow */ if (aspen_getopt('wrap_shadow')) { aspen_f_write($sout, sprintf("#wrapper {-webkit-box-shadow: 0 0 3px 3px rgba(0,0,0,0.25); -moz-box-shadow: 0 0 3px 3px rgba(0,0,0,0.25); box-shadow: 0 0 3px 3px rgba(127,127,127,0.25);}\n")); } // ========================= LAYOUT / SIDEBAR AREAS =============================== $themew = aspen_getopt('theme_width_int'); if (!$themew) $themew = 940; // nothing will work right if this doesn't have a value $wrap_pad = aspen_getopt('wrapper_padding'); if ($wrap_pad == '') $wrap_pad = 10; if (aspen_getopt_checked('theme_width_fixed')) { aspen_f_write($sout,sprintf("#wrapper{max-width:%dpx;width:%dpx;}\n",$themew,$themew)); } else { aspen_f_write($sout,sprintf("#wrapper{max-width:%dpx;}\n",$themew)); } aspen_css_style_val($sout, '#wrapper', '{padding: %dpx;}', 'wrapper_padding'); // wrapper padding $sb_areas = array ('primary' => '#primary-widget-area,.mobile_widget_area', 'right' => '#right-widget-area', 'left' => '#left-widget-area', 'top' => '.sidebar_top', 'bottom' => '.sidebar_bottom', 'footer' => '#first,#second,#third,#fourth', 'widget'=>'.widget'); /* _bgcolor, _margin_T, _margin_B, _std_border */ foreach ($sb_areas as $area => $tag) { $id = 'widget_' . $area; aspen_put_bgcolor($sout, $id . '_bgcolor', $tag); $mt = aspen_getopt($id . '_margin_T'); $mb = aspen_getopt($id . '_margin_B'); // make each separate because might not want to override defaults $rule = ''; $rule .= $mt != '' ? 'margin-top:' . $mt . 'px;' : ''; $rule .= $mb != '' ? 'margin-bottom:' . $mb . 'px;' : ''; if ($rule) { aspen_f_write($sout, $tag . '{' . $rule . "}\n"); } if (aspen_getopt_checked($id . '_std_border')) { if (!aspen_getopt_checked('useborders') || $tag == '.widget') aspen_f_write($sout, sprintf("%s {border: %dpx %s %s;}\n",$tag,$b_w, $b_s, $b_c)); } } // 'widget_top_indent_int', bottom if (($val = aspen_getopt('widget_top_indent_int')) != '') { aspen_f_write($sout, sprintf(".sidebar_top,.sidebar_extra {margin-left: %.3f%%;margin-right: %.3f%%;}\n", $val,$val)); } if (($val = aspen_getopt('widget_bottom_indent_int')) != '') { aspen_f_write($sout, sprintf(".sidebar_bottom {margin-left: %.3f%%;margin-right: %.3f%%;}\n", $val,$val)); } // widget areas and widget margins interact - need to adjust depending on what widget margin are $ww_mtop = aspen_getopt('widget_widget_margin_T'); $ww_mbot = aspen_getopt('widget_widget_margin_B'); $w_pad = aspen_getopt('widget_padding_int'); if ($w_pad != '' || $ww_mtop != '' || $ww_mbot != '') { // either set top val or need to adjust $wmbot = $ww_mbot != '' ? $ww_mbot : '10'; if ($ww_mtop == '') $ww_mtop = 0; if ($w_pad == '') $w_pad = '10'; $t = '0'; $b = '0'; if ($w_pad != '0') { $t = $w_pad - $ww_mtop; if ($t < 0) $t = '0'; $b = $w_pad - $wmbot; if ($b < 0) $b = '0'; } aspen_f_write($sout, sprintf(".widget-area {padding: %dpx %dpx %dpx %dpx;}\n", $t,$w_pad,$b,$w_pad)); } if ($ww_mtop != '' && $ww_mbot != '') { // may generate extra .widget rules to overrde above .widgt in $sbareas aspen_f_write($sout, sprintf(".widget {margin-bottom: %dpx;margin-top: %dpx;}\n", $ww_mbot,$ww_mtop)); } else { if ($ww_mtop != '') aspen_f_write($sout, sprintf(".widget {margin-top: %dpx;}\n", $ww_mtop)); if ($ww_mbot != '') aspen_f_write($sout, sprintf(".widget {margin-bottom: %dpx;}\n", $ww_mbot)); } // 'widget_widget_padding_int' aspen_css_style_val($sout, '.widget', '{padding: %dpx;}', 'widget_widget_padding_int'); // The widths: 'theme_width_int' 'sb_right_2_col_width_int' 'sb_left_1_col_width_int' 'sb_left_2_col_width_int' // 'sb_split_left_width_int' 'sb_split_right_width_int' 'sb_2_left_area_int' $cw = 100; // maybe add content width option in the future. $sbw = aspen_getopt('sb_right_1_col_width_int'); //+ ALL if ($sbw != '') { aspen_f_write($sout, sprintf("#container_wrap.right-1-col{width:%.3f%%;} #sidebar_wrap_right.right-1-col{width:%.3f%%;}\n",$cw-$sbw,$sbw)); } $sbw = aspen_getopt('sb_right_2_col_width_int'); if ($sbw != '') { aspen_f_write($sout, sprintf("#container_wrap.right-2-col,#container_wrap.right-2-col-bottom{width:%.3f%%;} #sidebar_wrap_right.right-2-col,#sidebar_wrap_right.right-2-col-bottom{width:%.3f%%;}\n",$cw-$sbw,$sbw)); } $sbw = aspen_getopt('sb_left_1_col_width_int'); if ($sbw != '') { aspen_f_write($sout, sprintf("#container_wrap.left-1-col{width:%.3f%%;} #sidebar_wrap_left.left-1-col{width:%.3f%%;}\n",$cw-$sbw,$sbw)); } $sbw = aspen_getopt('sb_left_2_col_width_int'); if ($sbw != '') { aspen_f_write($sout, sprintf("#container_wrap.left-2-col,#container_wrap.left-2-col-bottom{width:%.3f%%;} #sidebar_wrap_left.left-2-col,#sidebar_wrap_left.left-2-col-bottom{width:%.3f%%;}\n",$cw-$sbw,$sbw)); } $sbwl = aspen_getopt('sb_split_left_width_int'); $sbwr = aspen_getopt('sb_split_right_width_int'); if ($sbwl != '' && $sbwr != '') { aspen_f_write($sout, sprintf("#container_wrap{width:%.3f%%;} #sidebar_wrap_left{width:%.3f%%;} #sidebar_wrap_right{width:%.3f%%;}\n", $cw-$sbwl-$sbwr,$sbwl,$sbwr)); } // Margins for sidebar widget areas $m = aspen_getopt('sidbar_widget_margins_L'); if ($m != '') aspen_f_write($sout, sprintf("#primary-widget-area,#left-widget-area,#right-widget-area,.mobile_widget_area {margin-left:%spx !important;}\n",$m)); $m = aspen_getopt('sidbar_widget_margins_R'); if ($m != '') aspen_f_write($sout, sprintf("#primary-widget-area,#left-widget-area,#right-widget-area,.mobile_widget_area {margin-right:%spx !important;}\n",$m)); $sbw = aspen_getopt('sb_2_left_area_int'); if ($sbw != '') { aspen_f_write($sout, sprintf("#sidebar_wrap_2_left_left, #sidebar_wrap_2_right_left {width:%.3f%%;margin-right:1%%;}\n#sidebar_wrap_2_left_right, #sidebar_wrap_2_right_right {width:%.3f%%;}\n",$sbw-1,$cw-$sbw)); } $t = aspen_getopt('site_margins_T'); $b = aspen_getopt('site_margins_B'); $l = aspen_getopt('site_margins_L'); $r = aspen_getopt('site_margins_R'); if ($t != '' || $b != '' || $l != '' || $r != '') { if ($t == '') $t = 20; // default if not set if ($b == '') $b = 20; if ($l == '') $l = 20; if ($r == '') $r = 20; aspen_f_write($sout, sprintf("body {padding: %dpx %dpx %dpx %dpx; }\n",$t,$r,$b,$l)); } // =========================== HEADER OPTIONS =============================== aspen_css_style_val($sout, '#branding', '{padding-top:%dpx;}', 'branding_padding_T'); aspen_css_style_val($sout, '#branding', '{padding-bottom:%dpx;}', 'branding_padding_B'); aspen_css_style_val($sout, '#main', '{padding: %dpx 0 0 0;}', 'after_header_int'); aspen_css_style_val($sout, '#site-title', '{font-size:%.3f%%;}', 'title_font_size'); aspen_css_style_val($sout, '#site-description', '{font-size:%.3f%%;}', 'desc_font_size'); aspen_css_style_val($sout, '#site-title', '{max-width:%.3f%%;}', 'title_max_w'); aspen_css_style_val($sout, '#site-description', '{max-width:%.3f%%;}', 'desc_max_w'); /* Site Title/Description Site Title' => 'title_color' Site Title Font Size => 'title_font_size' Title Position => 'title_position_xy' Move Title over Header Image => 'title_over_header' Site Description => 'desc_color' Site Description Font Size => 'desc_font_size' Description Position => 'desc_position_xy' Move Description over Header Image => 'desc_over_header' Header Extra HTML => 'header_html' Extra HTML Position => 'header_html_position_xy', Move Extra HTML over Header Image => 'header_html_over_header' Hide on Mobile', 'id' =>'header_html_hide_mobile' */ if (aspen_getopt('title_over_header')) { $tx = 2; $ty = 5; // default values for offsets $val = aspen_getopt('title_position_xy_X'); if ($val != '') $tx = $val; $val = aspen_getopt('title_position_xy_Y'); if ($val != '') $ty = $val; aspen_f_write($sout, sprintf("#site-title{overflow:hidden; padding:0; margin:0; position:absolute; left:%.3f%%; top: %.3f%%; z-index:20;}\n",$tx,$ty)); } else { $tx = aspen_getopt('title_position_xy_X'); $ty = aspen_getopt('title_position_xy_Y'); // new title margins if ($tx != '' || $ty != '') { aspen_f_write($sout, sprintf("#site-title{ margin-left:%.3f%%; margin-top:%.3f%%;}\n",$tx,$ty)); } } if (aspen_getopt('desc_over_header')) { $tx = 4; $ty = 30; // default values for offsets $val = aspen_getopt('desc_position_xy_X'); if ($val != '') $tx = $val; $val = aspen_getopt('desc_position_xy_Y'); if ($val != '') $ty = $val; aspen_f_write($sout, sprintf("#site-description {overflow:hidden; padding:0; margin:0; position:absolute; left:%.3f%%; top: %.3f%%; z-index:20;}\n", $tx,$ty)); } else { $tx = aspen_getopt('desc_position_xy_X'); $ty = aspen_getopt('desc_position_xy_Y'); // new title margins if ($tx != '' || $ty !='') { aspen_f_write($sout, sprintf("#site-description{ margin-left:%.3f%%; margin-top:%.3f%%;}\n",$tx,$ty)); } } $tx = 4; $ty = 40; // default values for offsets if (aspen_getopt('header_html_over_header')) { $val = aspen_getopt('header_html_position_xy_X'); if ($val != '') $tx = $val; $val = aspen_getopt('header_html_position_xy_Y'); if ($val != '') $ty = $val; aspen_f_write($sout, sprintf("#header-extra-html {overflow:hidden; padding:0; margin:0; position:absolute; left:%.3f%%; top: %.3f%%; z-index:20;}\n", $tx,$ty)); } else { $tx = aspen_getopt('header_html_position_xy_X'); $ty = aspen_getopt('header_html_position_xy_Y'); // new title margins if ($tx != '' || $ty != '') { aspen_f_write($sout, sprintf("#header-extra-html { margin-left:%.3f%%; margin-top:%.3f%%;}\n",$tx,$ty)); } } if (($img_maxw = aspen_getopt('header_html_img_maxw')) != '') { $maxcss = $img_maxw + $tx; if ($maxcss > 100) $maxcss = 100; aspen_f_write($sout, sprintf("#header-extra-html img.header-logo{display:block;height:auto;max-width:%.3f%%;}\n",$maxcss)); } if (aspen_getopt('header_actual_size')) { aspen_f_write($sout, '#branding #header_image img, #ie8 #branding #header_image img {width:auto;margin-left:auto;margin-right:auto;} '); } // =========================== FOOTER OPTIONS =============================== /* footer_border_color */ $fh = aspen_getopt('footer_border_int'); if ($fh == '') $fh = '4'; $fc = aspen_getopt('footer_border_color'); if ($fc == '') $fc = '#888'; if ($fh != '4' || $fc != '#888') { // write if not defaults aspen_f_write($sout, sprintf("#colophon { border-top: %dpx solid %s; }\n",$fh, $fc)); } aspen_css_css($sout,'#colophon','footer_border_color_css'); if (aspen_getopt('_hide_poweredby')) aspen_f_write($sout, "#site-info {width:80%;}\n"); // =========================== MENU OPTIONS =============================== /* text_color = 0.213 * this.rgb[0] + 0.715 * this.rgb[1] + 0.072 * this.rgb[2] < 0.5 ? '#FFF' : '#000'; */ aspen_put_rule_if_checked($sout,'bold_menu','.menu_bar a, .mobile_menu_bar a {font-weight:bold;}'); // aspen_put_rule_if_checked aspen_put_rule_if_checked($sout,'bold_submenu','.menu_bar ul ul a {font-weight:bold;}'); // bold_submenu aspen_put_rule_if_checked($sout,'italic_menu','.menu_bar a, .mobile_menu_bar a {font-style:italic;}'); // aspen_put_rule_if_checked aspen_put_rule_if_checked($sout,'italic_submenu','.menu_bar ul ul a {font-style:italic;}'); // italic_submenu if (($val = aspen_getopt('menu_height_int')) != '') { //+ menu_height_int aspen_f_write($sout,sprintf("#nav-bottom-menu, #nav-top-menu {min-height:%dpx;}\n",$val)); aspen_f_write($sout,sprintf(".menu_bar a {line-height:%dpx !important;}\n",$val)); aspen_f_write($sout,sprintf(".menu_bar ul ul a {line-height:%dpx !important;}\n",$val-20)); aspen_f_write($sout,sprintf(".menu_bar ul ul {top:%dpx;}\n",$val)); } if (aspen_getopt('gradient_menu')) { // gradient_menu $urlfade = aspen_relative_url('images/theme/fade.png'); $urlfadeup = aspen_relative_url('images/theme/fadeup.png'); $rule = '.menu_bar,.aspen_vertical_menu .menu_bar li'; if (aspen_getopt('header_first')) $rule .= ',#wrap-header #nav-top-menu,#wrap-header #nav-bottom-menu'; $threshold = aspen_getopt('mobile_slide_threshold'); $threshold = $threshold != '' ? ($threshold + 1) : '641'; aspen_f_write($sout, sprintf("@media only screen and (min-width: %dpx) {%s { background-image: url(%s);}}\n", $threshold, $rule, $urlfade)); aspen_f_write($sout, sprintf("@media only screen and (min-width: %dpx) {.menu_bar ul ul a, .menu_bar li:hover > a, .menu_bar ul ul :hover > a { background-image: url(%s);}}\n", $threshold,$urlfadeup)); } if (aspen_getopt_checked('menu_shadow')) { aspen_f_write($sout, sprintf('.menu_bar, .menu_bar ul {-webkit-box-shadow: rgba(0, 0, 0, 0.4) 2px 3px 7px; -moz-box-shadow: rgba(0, 0, 0, 0.4) 2px 3px 7px; box-shadow: rgba(0, 0, 0, 0.4) 2px 3px 7px;max-width:%dpx;}',$themew)); } /* use_superfish */ //if (!aspen_getopt('use_superfish')) { // need to fix up access a if NOT using SuperFish - at least with Aspen, maybe not here // aspen_f_write($sout, sprintf(".menu_bar a { padding-left:10px; padding-right:10px;}\n")); // } if ( aspen_use_sf() ) { aspen_f_write($sout,".menu_bar ul ul a {padding:10px 20px;}\n"); // make room for arrow $arrows = aspen_getopt('superfish_arrows'); if ($arrows && $arrows != '000000') { /* assumes 000000 is default arrow color */ if (is_rtl()) $url = aspen_relative_url('js/superfish/images/rtl-arrows-' . $arrows . '.png'); else $url = aspen_relative_url('js/superfish/images/arrows-' . $arrows . '.png'); aspen_f_write($sout, sprintf(".sf-sub-indicator {background: url(%s) no-repeat -10px -100px;}\n",$url)); } } aspen_put_color($sout,'menubar_text_color','.menu_bar, .menu_bar a,.menu_bar a:visited,.mobile_menu_bar a'); aspen_put_bgcolor($sout,'menubar_hover_bgcolor','.menu_bar li:hover > a, .menu_bar a:focus'); // menubar_hoverbg_color aspen_put_color($sout,'menubar_hover_color','.menu_bar li:hover > a, .menu_bar a:focus'); // menubar_hover_color aspen_put_bgcolor($sout,'submenubar_bgcolor','.menu_bar ul ul a'); // submenubar_bgcolor aspen_put_color($sout,'submenubar_text_color','.menu_bar ul ul a,.menu_bar ul ul a:visited'); // submenubar_text_color aspen_put_bgcolor($sout,'submenubar_hover_bgcolor','.menu_bar ul ul :hover > a'); // submenubar_hover_bgcolor aspen_put_color($sout,'submenubar_hover_color','.menu_bar ul ul :hover > a'); // submenubar_hover_color aspen_put_bgcolor($sout,'menubar_bgcolor','.menu_bar, .mobile_menu_bar, .menu-add'); // menubar_bgcolor /* HIDE MENU BAR - DESKTOP */ if (aspen_getopt('hide_menu_bar')) { $threshold = aspen_getopt('mobile_slide_threshold'); // default threshold if (aspen_getopt_checked('theme_width_fixed')) { // no menu swap if fixed width theme $threshold = 1; } else { $threshold = $threshold != '' ? $threshold : '640'; } if ($threshold == 0) $threshold = 1; // min-width 0 not good aspen_f_write($sout,'@media only screen and (min-width:'. $threshold . 'px) {#nav-top-menu,#nav-bottom-menuu{display:none;}} #ie7 #nav-top-menu,#ie8 #nav-bottom-menu,#ie7 #nav-top-menu,#ie8 #nav-bottom-menu{display:none;}'."\n"); } if (aspen_getopt('mobile_hide_secondary_menu')) { $threshold = aspen_getopt('mobile_slide_threshold'); // default threshold if (aspen_getopt_checked('theme_width_fixed')) { // no menu swap if fixed width theme $threshold = 1; } else { $threshold = $threshold != '' ? $threshold - 1 : '639'; } if ($threshold == 0) $threshold = 1; // min-width 0 not good aspen_f_write($sout,'@media only screen and (max-width:'. $threshold . 'px) { #nav-top-menu{display:none;}}'."\n"); } if (aspen_getopt('menu_center')) { aspen_f_write($sout, '#access.menu_bar div.menu, #access2.menu_bar div.menu {float:right;right:50%;position:relative;} .menu_bar ul,.menu_bar div {margin:0 auto;} .menu_bar li {left:50%;} .menu_bar ul ul {right:auto;} .menu_bar ul ul li {left:auto;} #access .menu-add {float:left;}'."\n"); } if (aspen_getopt('menu_right_primary')) { if (is_rtl()) { aspen_f_write($sout,'#access.menu_bar .menu {float:left;} #access .menu-add {float:right;}'); } else { aspen_f_write($sout,'#access.menu_bar .menu {float:right;} #access .menu-add {float:left;}'); } } if (aspen_getopt('menu_right_secondary')) { if (is_rtl()) { aspen_f_write($sout,'#access2.menu_bar .menu {float:left;}'); } else { aspen_f_write($sout,'#access2.menu_bar .menu {float:right;}'); } } aspen_css_style_val($sout, '.menu_bar', '{font-size:%d%%;}', 'menubar_text_size_int'); /* info bar */ // info_color info_padding aspen_put_bgcolor($sout,'infob_bgcolor','#infobar'); aspen_put_color($sout,'infob_color','#infobar'); aspen_css_style_val($sout, '#infobar', '{padding-left:%dpx;}', 'infob_padding_L'); aspen_css_style_val($sout, '#infobar', '{padding-right:%dpx;}', 'infob_padding_R'); aspen_css_style_val($sout, '#infobar', '{padding-top:%dpx;}', 'infob_padding_T'); aspen_css_style_val($sout, '#infobar', '{padding-bottom:%dpx;}', 'infob_padding_B'); aspen_css_style_val($sout, '#infobar', '{font-size:%d%%;}', 'infob_text_size_int'); /* vertical menu */ $mb_bg = aspen_getopt('menubar_bgcolor'); // Build the simple vertical menu based on existing $mb_sub = aspen_getopt('menubar_bgcolor'); // theme menu colors. $mb_hover = aspen_getopt('menubar_hover_bgcolor'); $text_color = aspen_getopt('menubar_text_color'); $text_hover = aspen_getopt('menubar_hover_color'); if (!$mb_bg) $mb_bg = 'inherit'; if (!$mb_sub) $mb_sub = 'inherit'; if (!$mb_hover) $mb_hover = 'inherit'; if (!$text_color) $text_color = 'inherit'; if (!$text_hover) $text_hover = 'inherit'; aspen_f_write($sout,sprintf(".mobile-menu-link {border-color:%s;}\n",$text_color)); $menu = sprintf(".menu-vertical {clear:both;background:transparent;margin:0;width:100%% !important;overflow:hidden !important;border-bottom:3px solid %s;border-top:1px solid %s;} .menu-vertical ul {margin: 0 !important; padding: 0 !important; list-style-type: none !important; list-style-image:none !important;font-family: inherit;} .menu-vertical li a, .menu-vertical a:visited {color: %s !important; background-color: %s !important; display: block !important; padding: 5px 10px !important; text-decoration: none !important; border-top:2px solid %s;} .menu-vertical a:hover,.menu-vertical a:focus {color: %s !important; background-color: %s !important;text-decoration: none !important;} .menu-vertical ul ul li { margin: 0 !important; } .menu-vertical ul ul a {color: %s !important; background-color: %s !important; display: block !important; padding: 4px 5px 4px 25px !important; text-decoration: none !important;border:0; border-top:1px solid %s;} .menu-vertical ul ul a:hover {color: %s !important; background-color: %s !important; text-decoration: none !important;} .menu-vertical ul ul ul a {padding: 4px 5px 4px 35px !important;} .menu-vertical ul ul ul ul a {padding: 4px 5px 4px 45px !important;} .menu-vertical ul ul ul ul ul a {padding: 4px 5px 4px 55px !important;}\n", $text_color, $text_color, $text_color, $mb_bg, $text_color, $text_hover, $mb_hover, $text_color, $mb_sub, $text_color, $text_hover, $mb_hover); aspen_f_write($sout,$menu); $cur_page = aspen_getopt('menubar_curpage_noancestors') ? '.menu_bar .current_page_item > a, .menu_bar .current-menu-item > a, .menu_bar .current-cat > a, ' . '.menu-vertical .current_page_item > a, .menu-vertical .current-menu-item > a, .menu-vertical .current-cat > a, ' . '.widget-area .menu-vertical .current_page_item > a, .widget-area .menu-vertical .current-menu-item > a, .widget-area .menu-vertical .current-cat > a' : '.menu_bar .current_page_item > a, .menu_bar .current-menu-item > a, .menu_bar .current-cat > a, .menu_bar .current_page_ancestor > a,' . '.current-category-ancestor > a, .current-menu-ancestor > a, .current-menu-parent > a, .current-category-parent > a' . '.menu-vertical .current_page_item > a, .menu-vertical .current-menu-item > a, .menu-vertical .current-cat > a, .menu-vertical .current_page_ancestor > a, ' . '.widget-area .menu-vertical .current_page_item > a, .widget-area .menu-vertical .current-menu-item > a, .widget-area .menu-vertical .current-cat > a, .widget-area .menu-vertical .current_page_ancestor > a'; aspen_put_color($sout,'menubar_curpage_color', $cur_page, true); // menubar_curpage_color aspen_put_rule_if_checked($sout,'menubar_curpage_em', $cur_page .'{font-style:italic}'); // menubar_curpage_em aspen_put_rule_if_checked($sout,'menubar_curpage_bold', $cur_page . '{font-weight:bold}'); // =========================== CONTENT AREAS =============================== if (aspen_getopt_checked('hide_img_borders')) { aspen_f_write($sout,'#content .size-full, #content .size-large, #content .size-medium, #content .size-thumbnail,#content .size-thumbnail, #content .gallery img,#content .gallery-thumb img,.entry-attachment img, #content img.wp-post-image #content img[class*="wp-image-"] {background-color:transparent !important;padding:0;}'."\n"); aspen_f_write($sout, "#content img,#author-avatar img,#content img[class*=\"wp-image-\"],img.avatar {padding:0;}\n"); } if (!aspen_getopt_checked('hide_img_shadows')) { aspen_f_write($sout, "#content img,#author-avatar img,#content img[class*=\"wp-image-\"],img.avatar {-webkit-box-shadow:0 1px 2px #bbb;-moz-box-shadow:0 1px 2px #bbb;box-shadow:0 1px 2px #bbb;}\n"); } else { aspen_f_write($sout, "#author-avatar img,img.avatar {-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}\n"); } aspen_css_style_val($sout, '#content', '{font-size:%d%%;}', 'content_size_int'); aspen_css_style_val($sout, '#content .entry-title', '{font-size:%d%%;}', 'entrytitle_size_int'); aspen_css_style_val($sout, '.widget-area', '{font-size:%d%%;}', 'widget_size_int'); aspen_css_style_val($sout, '#colophon', '{font-size:%d%%;}', 'footer_size_int'); $val = aspen_getopt('contentlist_bullet'); if ($val != '' && $val != 'disc') { aspen_f_write($sout, sprintf("#content ul {list-style-type:%s;}\n",$val)); } $val = (int)aspen_getopt('header_underline_int'); /* bar under headers */ if ($val != '' && $val != 0) { $titleColor = aspen_getopt('page_title_color'); if ($titleColor == '') $titleColor = '#222'; aspen_f_write($sout, sprintf(".entry-title {border-bottom: $val"."px solid $titleColor;}\n")); } aspen_css_style_val($sout, '.entry-content,.entry-summary', '{padding-top:%.3fem;}', 'content_top_dec'); aspen_css_style_val($sout, '#content p,#content ul,#content ol', '{margin-bottom:%.3fem;}', 'content_p_list_dec'); /* content_color */ aspen_put_color($sout,'content_color','#content, .entry-content h1, .entry-content h2'); /* content_headings_color */ aspen_put_color($sout,'content_headings_color', '#content h1, #content h2, #content h3, #content h4, #content h5, #content h6, #content dt, #content th, h1, h2, h3, h4, h5, h6,#author-info h2'); /* page_title_color - MUST come after content_headings_color! */ aspen_put_color($sout, 'page_title_color','#content h1.entry-title'); /* Comments */ $b_c = aspen_getopt('border_color'); // if (!$b_c) $b_c = '#222'; $b_w = aspen_getopt('border_width_int'); // if (!$b_w) $b_w = 1; aspen_put_rule_if_checked($sout,'show_comment_borders', ".commentlist li.comment, #respond,.commentlist li.comment .comment-author img.avatar,.commentlist .comment.bypostauthor {border:{$b_w}px solid $b_c;}"); aspen_put_rule_if_checked($sout,'hide_comment_bubble', '#comments-title {background-image:none!important;padding-left:0px;font-size:140%;}'); aspen_put_rule_if_checked($sout,'hide_comment_hr', 'hr.comments-hr {display:none;}'); aspen_put_color($sout, 'comment_headings_color', '#comments-title h3, #comments-title h4, #respond h3' ); aspen_put_bgcolor($sout, 'comment_content_bgcolor', '.commentlist li.comment, #respond' ); aspen_put_bgcolor($sout,'comment_submit_bgcolor','#respond input#submit'); /* aspen_tables */ $table = aspen_getopt('aspen_tables'); if ($table == 'wide') { // make backward compatible with 1.4 and before when Twenty Ten was default aspen_f_write($sout, sprintf("#content table {border: 1px solid #e7e7e7;margin: 0 -1px 24px 0;text-align: left;width: 100%%;} #content tr th, #content thead th {color: #888;font-size: 12px;font-weight: bold;line-height: 18px;padding: 9px 24px;} #content tr td {border-style:none; border-top: 1px solid #e7e7e7; padding: 6px 24px;} #content tr.odd td {background: #f2f7fc;}\n")); } elseif ($table == 'bold') { aspen_f_write($sout, sprintf("#content table {border: 2px solid #888;} #content tr th, #content thead th {font-weight: bold;} #content tr td {border: 1px solid #888;}\n")); } elseif ($table == 'noborders') { aspen_f_write($sout, sprintf("#content table {border-style:none;} #content tr th, #content thead th {font-weight: bold;border-bottom: 1px solid #888;background-color:transparent;} #content tr td {border-style:none;}\n")); } elseif ($table == 'fullwidth') { aspen_f_write($sout, sprintf("#content table {width:100%%;} #content tr th, #content thead th {font-weight:bold;}\n")); } elseif ($table == 'plain') { aspen_f_write($sout, sprintf( "#content table {border: 1px solid #888;text-align:left;margin: 0 0 0 0;width:auto;} #content tr th, #content thead th {color: inherit;background:none;font-weight:normal;line-height:normal;padding:4px;} #content tr td {border: 1px solid #888; padding:4px;}\n")); } aspen_css_style_val($sout, '#content .size-full, #content .size-large, #content .size-medium, #content .size-thumbnail, #content .gallery img,#content .gallery-thumb img,.entry-attachment img,#content .wp-caption img, #content img.wp-post-image,#content img[class*="wp-image-"]', '{padding:%dpx;}', 'media_lib_border_int'); aspen_css_style_val($sout, '#content .page .featured-image img.wp-post-image', '{height: auto; max-width:%spx !important;}', 'featured_page_width'); aspen_css_style_val($sout, '.single-post #content .post .featured-image img.wp-post-image', '{height: auto; max-width:%spx !important;}', 'featured_single_width'); if (($val = aspen_getopt('featured_blog_width')) != '') { aspen_f_write($sout,sprintf(".blog #content .featured-image img.wp-post-image, .archive #content .featured-image img.wp-post-image, .search #content .featured-image img.wp-post-image {height: auto; max-width:%spx;}\n",$val)); // use width for widget areas - the widget area max-width will override if needed } aspen_css_style_val($sout, '#content', '{padding-left:%dpx;}', 'content_padding_L'); aspen_css_style_val($sout, '#content', '{padding-right:%dpx;}', 'content_padding_R'); aspen_css_style_val($sout, '#content', '{padding-top:%dpx;}', 'content_padding_T'); aspen_css_style_val($sout, '#content', '{padding-bottom:%dpx;}', 'content_padding_B'); /* caption_color */ aspen_put_color($sout,'caption_color','.wp-caption p.wp-caption-text, #content .gallery .gallery-caption,.entry-attachment .entry-caption'); /* media_lib_border */ $tag = '#content img.size-full, #content img.size-large, #content img.size-medium, #content img.size-thumbnail, #content .attachment-thumbnail, #content .gallery img,#content .gallery-thumb img,.entry-attachment img, #content .wp-caption img, #content img.wp-post-image,#content img[class*="wp-image-"],#author-avatar img,img.avatar'; aspen_put_bgcolor($sout,'media_lib_border_color', $tag); // =========================== POST SPECIFIC AREAS =============================== aspen_put_rule_if_checked($sout, 'show_comments_closed','.nocomments {display:block;}'); aspen_put_rule_if_checked($sout, 'nav_show_first','#nav-above{display:block;}'); // put this one first, so hide can override aspen_put_rule_if_checked($sout, 'nav_hide_above','#nav-above,.paged #nav-above{display:none;margin:0;}'); aspen_put_rule_if_checked($sout, 'nav_hide_below','#nav-below{display:none;margin:0;}'); if (aspen_getopt('single_nav_style') == 'hide' || aspen_getopt_checked('single_nav_hide_above')) { aspen_f_write($sout,".single #nav-above{display:none;margin:0;}\n"); } if (aspen_getopt('single_nav_style') == 'hide' || aspen_getopt_checked('single_nav_hide_below')) { aspen_f_write($sout,".single #nav-below{display:none;margin:0;}\n"); } $nav = aspen_getopt('nav_style'); // paged can take more than 50% if ($nav == 'paged_left') aspen_f_write($sout,".nav-previous {width:95%;}\n"); if ($nav == 'paged_right') aspen_f_write($sout,".nav-next {width:95%;}\n"); /* stickypost_bgcolor */ aspen_put_bgcolor($sout,'stickypost_bgcolor', '.home .sticky, #author-info, #container.page-with-posts .sticky, #container.index-posts .sticky'); aspen_css_style_val($sout, '#content .post', '{padding-left:%dpx;}', 'post_padding_L'); aspen_css_style_val($sout, '#content .post', '{padding-right:%dpx;}', 'post_padding_R'); aspen_css_style_val($sout, '#content .post', '{padding-top:%dpx;}', 'post_padding_T'); aspen_css_style_val($sout, '#content .post', '{padding-bottom:%dpx;}', 'post_padding_B'); aspen_css_style_val($sout, '.entry-meta, .entry-utility', '{font-size:%d%%;}', 'info_font_size_int'); aspen_put_color($sout,'post_format_color','#content .entry-format'); // post_format_color aspen_put_rule_if_checked($sout, 'hide_post_format_title','#content .entry-format{display:none;}'); aspen_put_color($sout,'info_color','.entry-meta, .entry-content label, .entry-utility'); /* info_color */ aspen_put_rule_if_checked($sout, 'post_hide_single_author','.single-author .entry-meta .by-author {display:none;}'); // ============================== WIDGET AREAS =================================== $val = aspen_getopt('widgetlist_bullet'); if ($val != '' && $val != 'disc') { aspen_f_write($sout, sprintf(".widget ul {list-style-type:%s;}\n",$val)); } // ================================== FONTS ===================================== aspen_css_style_val($sout, 'body', '{font-size:%dpx;}', 'site_fontsize_int'); aspen_css_style_val($sout, 'body', '{line-height:%.3f;}', 'site_line_height_dec'); aspen_css_style_val($sout, 'body', '{font-family:%s;}', 'content_font'); aspen_css_style_val($sout, 'h3#comments-title,h3#reply-title,.menu_bar,.mobile_menu_bar, #author-info,#infobar,#nav-above, #nav-below,#cancel-comment-reply-link,.form-allowed-tags, #site-info,#site-title,#wp-calendar,#comments-title,.comment-meta,.comment-body tr th,.comment-body thead th, .entry-content label,.entry-content tr th,.entry-content thead th,.entry-format,.entry-meta,.entry-title, .entry-utility,#respond label,.navigation,.page-title,.pingback p,.reply,.widget-title, .wp-caption-text,input[type=submit]', '{font-family:%s;}', 'title_font'); // ================================ COLORS =================================== // Colors need to go last because they might have CSS + /* background areas */ aspen_put_bgcolor($sout,'body_bgcolor','body'); // body aspen_put_color($sout,'body_color','body'); // body aspen_put_bgcolor($sout,'page_bgcolor','#wrapper'); // #wrapper aspen_put_bgcolor($sout,'main_bgcolor','#main'); // #main aspen_put_bgcolor($sout,'container_bgcolor','#container'); // #container aspen_put_bgcolor($sout,'content_bgcolor','#content'); // #content aspen_put_bgcolor($sout,'post_bgcolor','#content .post'); // .post aspen_put_bgcolor($sout,'post_author_bgcolor','#author-info'); // .post aspen_put_bgcolor($sout,'header_bgcolor','#branding'); // #branding aspen_put_bgcolor($sout,'footer_bgcolor','#colophon'); // #colophon aspen_put_color($sout,'footer_color','#colophon'); // #colophon aspen_put_bgcolor($sout,'footer_widget_bgcolor','#first,#second, #third, #fourth'); // #first,#second, #third, #fourth aspen_put_bgcolor($sout,'hr_color','hr'); // hr aspen_put_bgcolor($sout,'infotop_bgcolor','.entry-meta'); // .entry-meta aspen_put_bgcolor($sout,'infobottom_bgcolor','.entry-utility'); // .entry-utility /* input, text area */ aspen_put_bgcolor($sout,'input_bgcolor','input, textarea, ins, pre'); aspen_put_color($sout,'input_color','input, textarea'); // Sidebar wrappers $sb_bg = array( 'sb_right_1_col_bgcolor' => '#sidebar_wrap_right.right-1-col', //+ ALL 'sb_right_2_col_bgcolor' => '#sidebar_wrap_right.right-2-col,#sidebar_wrap_right.right-2-col-bottom', 'sb_left_1_col_bgcolor' => '#sidebar_wrap_left.left-1-col', 'sb_left_2_col_bgcolor' => '#sidebar_wrap_left.left-2-col,#sidebar_wrap_left.left-2-col-bottom', 'sb_split_left_bgcolor' => '#sidebar_wrap_left', 'sb_split_right_bgcolor' => '#sidebar_wrap_right' ); foreach ($sb_bg as $id => $tag) { aspen_put_bgcolor($sout,$id,$tag); // #header } aspen_put_color($sout,'widget_color', '.widget'); $titleColor = aspen_getopt('widget_title_color'); if ($titleColor == '') $titleColor = aspen_getopt('page_title_color'); if ($titleColor == '') $titleColor = '#222'; /* if they want a border, this is the fallback color */ if (($val = aspen_getopt('widget_header_underline_int')) != '') { aspen_f_write($sout, sprintf(".widget-title {border-bottom: $val"."px solid $titleColor; margin-bottom:5px;padding-bottom:3px;}\n")); } /* widget_title_color */ aspen_css_color($sout,'.widget-title, .widget_search label, #wp-calendar caption', aspen_getopt('widget_title_color')); aspen_css_css($sout,'.widget-title', 'widget_title_color_css'); // site title/description aspen_css_style_val($sout, '#site-title a', '{color:%s;}', 'title_color'); aspen_css_css($sout,'#site-title, #site-title a', 'title_color_css'); aspen_put_color($sout,'desc_color','#site-description'); // desc_color if (aspen_getopt('hide_site_title')) { aspen_f_write($sout, "@media only screen and (min-width: 581px) { #site-title{display:none;}} #ie7 #site-title, #ie8 #site-title {display:none;} .aspen-smalltablet-sim #site-title{display:none;} .aspen-phone #site-title{display:block;} #site-description{display:none;}\n"); } if (aspen_getopt('hide_site_title_mobile')) { aspen_f_write($sout, "@media only screen and (max-width: 580px) {#site-title{display:none;}}\n"); } if (aspen_getopt('desc-show-mobile')) { aspen_f_write($sout, "@media only screen and (max-width: 580px) {#site-description{display:block;}}\n"); } $htmls = array ('header', 'mobile_header', 'desktop_header', 'footer', 'prewrapper', 'preheader', 'premain', 'precontent', 'postpostcontent', 'precomments', 'postcomments', 'prefooter', 'postfooter', 'presidebar_left', 'presidebar_right'); foreach ( $htmls as $val) { // includes areas from Aspen Pro, too. $prefix = ($val == 'postpostcontent') ? '.' : '#'; aspen_put_bgcolor($sout,'inject_' . $val . '_bgcolor', $prefix . 'inject_' . $val); } // ================================ PRO AREAS =================================== do_action('aspen_pro_css',$sout); aspen_mobile_output_style($sout); $add_css = aspen_getopt('add_css'); if (!empty($add_css)) aspen_f_write($sout, apply_filters('aspen_css',$add_css) ); aspen_f_write($sout, "\n/* end Aspen CSS */\n"); // ================================ DIAGNOSTICS - LAST =================================== } // ================================ MOBILE CODE =================================== function aspen_mobile_output_style($sout) { aspen_f_write($sout,"/* Aspen Mobile Device Options */\n"); if (aspen_getopt('mobile_hide_menu_extras')) { aspen_f_write($sout,".menu-vertical .menu-add{display:none !important;}\n"); } if (aspen_getopt('mobile_slide_threshold') >= 5000) /* reduces flash of standard menu */ aspen_f_write($sout,"#nav-bottom-menu,#nav-top-menu {display:none;} #mobile-bottom-nav,#mobile-top-nav {display:block;}\n"); // ------ Tablet ----------- aspen_f_write($sout, "@media only screen and (max-width:768px) and (orientation:portrait) {\n"); aspen_f_write($sout,"}\n"); // @@@@@ formerly slider code went here... // ----- Mobile - Small Tablets + Phones aspen_f_write($sout,"@media only screen and (max-width:640px) {\n"); // @media if (aspen_getopt_checked('mobile_hide_header_image')) aspen_f_write($sout,"#header_image {display:none;}\n"); aspen_css_style_val($sout, 'body', '{font-size:%dpx !important;}', 'site_fontsize_mobile_int'); if (aspen_getopt_checked('mobile_nounderline')) aspen_f_write($sout, "#main a, #mobile-widget-area a, .sidebar_top a, .sidebar_bottom a, .sidebar_extra a{text-decoration: none !important;}\n"); if (($opt = aspen_getopt('mobile_title_color'))) aspen_f_write($sout,sprintf("#site-title a {color:$opt;}\n"),$opt); if (aspen_getopt_checked('mobile_show_footerwidgets')) aspen_f_write($sout,".aspen-mobile-resp-nostack #sidebar_wrap_footer {display:block;}\n"); if (aspen_getopt_checked('mobile_hide_topbottom_widgets')) aspen_f_write($sout,".sidebar_top, .sidebar_bottom {display:none;}\n"); aspen_f_write($sout,"}\n"); // end @media // ----- Phones aspen_f_write($sout,"@media only screen and (max-width: 580px) {\n"); if (aspen_getopt_checked('desc-show-mobile')) aspen_f_write($sout,"#site-description {display:block;}\n"); aspen_f_write($sout,"}\n"); } function aspen_css_style($sout, $name, $style) { /* output a css rule style (include {}'s in style) */ if ($style == '' || !$name) return; aspen_f_write($sout, "$name $style\n"); } function aspen_css_style_val($sout, $name, $style, $opt) { /* output a css rule style with one value (include {}'s in style) */ $val = aspen_getopt($opt); if ($val == '' || $val === false || !$style || !$name) return; aspen_f_write($sout, sprintf("$name $style\n",$val)); } function aspen_css_color($sout, $name, $color) { /* output a CSS color rule */ if ($color == '' || !$name) return; aspen_f_write($sout, "$name {color: $color;}\n"); } function aspen_css_css($sout, $name, $opt) { /* output a CSS css rule */ $style = aspen_getopt($opt); if ($style == '' || $style === false || !$name) return; aspen_f_write($sout, "$name" . apply_filters('aspen_css',$style) . "\n"); } function aspen_put_link($sout,$id, $a, $avisited, $ahover) { aspen_put_color($sout,$id.'_color',$a); aspen_put_color($sout,$id.'_visited_color',$avisited); aspen_put_color($sout,$id.'_hover_color',$ahover); $link_u = aspen_getopt_checked('link_u'); // always fetch standard link attributes $link_em = aspen_getopt_checked('link_em'); $link_strong = aspen_getopt_checked('link_strong'); if ($id == 'link') { aspen_put_rule_if_checked($sout,'link_u',$ahover . '{text-decoration:underline;}'); aspen_put_rule_if_checked($sout,'link_em',$a.'{font-style:italic;}'); aspen_put_rule_if_checked($sout,'link_strong',$a . '{font-weight:bold;}'); } else { $def_u = aspen_getopt_checked($id.'_u'); $def_em = aspen_getopt_checked($id.'_em'); $def_strong = aspen_getopt_checked($id.'_strong'); if ($link_u) aspen_put_rule_if_not_checked($sout,$id.'_u',$ahover . '{text-decoration:none;}'); else aspen_put_rule_if_checked($sout,$id.'_u',$ahover . '{text-decoration:underline;}'); if ($link_em) aspen_put_rule_if_not_checked($sout,$id.'_em',$a.'{font-style:normal;}'); else aspen_put_rule_if_checked($sout,$id.'_em',$a.'{font-style:italic;}'); if ($link_strong) aspen_put_rule_if_not_checked($sout,$id.'_strong',$a . '{font-weight:normal;}'); else aspen_put_rule_if_checked($sout,$id.'_strong',$a . '{font-weight:bold;}'); } } function aspen_put_bgcolor($sout, $opt, $tag) { // put bgcolor and CSS+ if (($color = aspen_getopt($opt))) { if (strpos($color,'rgba') === false) { // regular color aspen_f_write($sout, sprintf("$tag {background-color:$color;}\n")); } else { // rgba - so create IE8 compatible version as well $argb = aspen_rgba2argb($color); $split = explode(',', $tag); $ie8 = ''; $ie7 = ''; foreach ($split as $id) { if ($ie8 != '') { $ie8 .= ','; $ie7 .= ','; } $ie8 .= '#ie8 ' . $id; $ie7 .= '#ie7 ' . $id; } if (strpos($opt,'menubar') !== false) { // menus don't work with transparent bg in IE 7/8 $bgcss = 'background-color:#' . substr($argb,3) . ';'; // use the non-transparent color provided } else { // reset background for IE $bgcss = 'background-color:transparent;'."\n"; // Filters for IE: $bgcss .= '-ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='.$argb.',endColorstr='.$argb.');'."\n"; $bgcss .= 'filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='.$argb.',endColorstr='.$argb.');'."\n"; $bgcss .= 'zoom:1 !important;'; } aspen_f_write($sout, sprintf("$ie7,\n$ie8 { $bgcss }\n")); aspen_f_write($sout, sprintf("$tag {background-color:$color;}\n")); // the standard value } } if (($style = aspen_getopt($opt . '_css')) ) { aspen_f_write($sout, apply_filters('aspen_css', sprintf("%s %s\n",$tag,$style))); } } function aspen_rgba2argb($rgba_in) { // convert rgba(1,2,3,.4) to #aarrggbb if (strpos($rgba_in,'rgba') === false) return $rgba_in; $rgb = $rgba_in; $rgb = str_replace('rgba','',$rgb); // eliminate the rgba() and spaces $rgb = str_replace('(','',$rgb); $rgb = str_replace(')','',$rgb); $rgb = str_replace(' ','',$rgb); list($r,$g,$b,$a) = explode(',',$rgb); // retrieve the rgba values $a = intval($a * 255.); $r = intval($r); $g = intval($g); $b = intval($b); $hex = "#"; $hex .= str_pad(dechex($a), 2, "0", STR_PAD_LEFT); $hex .= str_pad(dechex($r), 2, "0", STR_PAD_LEFT); $hex .= str_pad(dechex($g), 2, "0", STR_PAD_LEFT); $hex .= str_pad(dechex($b), 2, "0", STR_PAD_LEFT); return $hex; } function aspen_put_color($sout, $id, $tag, $important=false) { // put color and CSS+ if (($color = aspen_getopt($id))) { if ($important) aspen_f_write($sout, sprintf("$tag {color:$color !important;}\n")); else aspen_f_write($sout, sprintf("$tag {color:$color;}\n")); } if (($style = aspen_getopt($id . '_css')) ) { aspen_f_write($sout, apply_filters('aspen_css', sprintf("%s %s\n",$tag,$style))); } } function aspen_put_rule_if_checked($sout, $id, $rule) { // put just a rule if checked if (aspen_getopt_checked($id)) { aspen_f_write($sout, $rule . "\n"); } } function aspen_put_rule_if_not_checked($sout, $id, $rule) { // put just a rule if not checked if (!aspen_getopt_checked($id)) { aspen_f_write($sout, $rule . "\n"); } } ?>