function css() { global $ss_settings; if (is_array($ss_settings['header_bg'])) { $bg = StacheStack_Color::sanitize_hex($ss_settings['header_bg']['background-color']); } else { $bg = StacheStack_Color::sanitize_hex($ss_settings['header_bg']); } $cl = StacheStack_Color::sanitize_hex($ss_settings['header_color']); $header_margin_top = $ss_settings['header_margin_top']; $header_margin_bottom = $ss_settings['header_margin_bottom']; $opacity = intval($ss_settings['header_bg_opacity']) / 100; $rgb = StacheStack_Color::get_rgb($bg, true); if ($ss_settings['site_style'] == 'boxed') { $element = 'body .before-main-wrapper .header-boxed'; } else { $element = 'body .before-main-wrapper .header-wrapper'; } if ($ss_settings['header_toggle'] == 1) { $style = $element . ' a, ' . $element . ' h1, ' . $element . ' h2, ' . $element . ' h3, ' . $element . ' h4, ' . $element . ' h5, ' . $element . ' h6 { color: ' . $cl . '; }'; $style .= $element . '{ color: ' . $cl . ';'; if ($opacity < 1 && !$ss_settings['header_bg']['background-image']) { $style .= 'background: rgb(' . $rgb . '); background: rgba(' . $rgb . ', ' . $opacity . ');'; } if ($header_margin_top > 0) { $style .= 'margin-top:' . $header_margin_top . 'px;'; } if ($header_margin_bottom > 0) { $style .= 'margin-bottom:' . $header_margin_bottom . 'px;'; } $style .= '}'; wp_add_inline_style('stachestack_css', $style); } }
/** * Any Jumbotron-specific CSS that can't be added in the .less stylesheet is calculated here. */ function jumbotron_css() { global $ss_settings; $center = $ss_settings['jumbotron_center']; $border = $ss_settings['jumbotron_border']; $opacity = intval($ss_settings['jumbotron_bg_opacity']) / 100; if (is_array($ss_settings['jumbo_bg'])) { $bg = StacheStack_Color::sanitize_hex($ss_settings['jumbo_bg']['background-color']); } else { $bg = StacheStack_Color::sanitize_hex($ss_settings['jumbo_bg']); } $rgb = StacheStack_Color::get_rgb($bg, true); $style = ''; if ($center == 1) { $style .= 'text-align: center;'; } if (!empty($border) && $border['border-bottom'] > 0 && !empty($border['border-color'])) { $style .= 'border-bottom:' . $border['border-bottom'] . ' ' . $border['border-style'] . ' ' . $border['border-color'] . ';'; } if ($opacity < 1 && !$ss_settings['jumbo_bg']['background-image']) { $style .= 'background: rgb(' . $rgb . '); background: rgba(' . $rgb . ', ' . $opacity . ') !important;'; } $style .= 'margin-bottom: 0px;'; $theCSS = '.jumbotron {' . trim($style) . '}'; wp_add_inline_style('stachestack_css', $theCSS); }
/** * If the options selected require the insertion of some custom CSS to the document head, generate that CSS here */ function css() { global $ss_settings; $bg = $ss_settings['footer_background']; $cl = $ss_settings['footer_color']; $cl_brand = $ss_settings['color_brand_primary']; $opacity = intval($ss_settings['footer_opacity']) / 100; $rgb = StacheStack_Color::get_rgb($bg, true); $border = $ss_settings['footer_border']; $top_margin = $ss_settings['footer_top_margin']; $container_margin = $top_margin * 0.381966011; $style = 'footer.content-info {'; $style .= 'color:' . $cl . ';'; $style .= $opacity != 1 && $opacity != "" ? 'background: rgba(' . $rgb . ',' . $opacity . ');' : 'background:' . $bg . ';'; $style .= !empty($border) && $border['border-top'] > 0 && !empty($border['border-color']) ? 'border-top:' . $border['border-top'] . ' ' . $border['border-style'] . ' ' . $border['border-color'] . ';' : ''; if (isset($ss_settings['layout_gutter'])) { $style .= 'padding-top:' . $ss_settings['layout_gutter'] / 2 . 'px;'; $style .= 'padding-bottom:' . $ss_settings['layout_gutter'] / 2 . 'px;'; } $style .= !empty($top_margin) ? 'margin-top:' . $top_margin . 'px;' : ''; $style .= '}'; $style .= 'footer div.container { margin-top:' . $container_margin . 'px; }'; $style .= '#copyright-bar { line-height: 30px; }'; $style .= '#footer_social_bar { line-height: 30px; font-size: 16px; text-align: right; }'; $style .= '#footer_social_bar a { margin-left: 9px; padding: 3px; color:' . $cl . '; }'; $style .= '#footer_social_bar a:hover, #footer_social_bar a:active { color:' . $cl_brand . ' !important; text-decoration:none; }'; wp_add_inline_style('stachestack_css', $style); }
/** * Add some CSS for the navbar when needed. */ function navbar_css() { global $ss_settings; $navbar_bg_opacity = $ss_settings['navbar_bg_opacity']; $style = ''; $opacity = $navbar_bg_opacity == '' ? '0' : intval($navbar_bg_opacity) / 100; if ($opacity != 1 && $opacity != '') { $bg = str_replace('#', '', $ss_settings['navbar_bg']); $rgb = StacheStack_Color::get_rgb($bg, true); $opacityie = str_replace('0.', '', $opacity); $style .= '.navbar, .navbar-default {'; if ($opacity != 1 && $opacity != '') { $style .= 'background: transparent; background: rgba(' . $rgb . ', ' . $opacity . '); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#' . $opacityie . $bg . ',endColorstr=#' . $opacityie . $bg . '); ;'; } else { $style .= 'background: #' . $bg . ';'; } $style .= '}'; } if ($ss_settings['navbar_margin'] != 1) { $style .= '.navbar-static-top { margin-top:' . $ss_settings['navbar_margin'] . 'px; margin-bottom:' . $ss_settings['navbar_margin'] . 'px; }'; } wp_add_inline_style('stachestack_css', $style); }
function stachestack_get_rgb($hex, $implode = false) { _stachestack_deprecated_function(__FUNCTION__, '3.2', 'StacheStack_Color::sanitize_hex()'); return StacheStack_Color::get_rgb($hex, $implode); }