Ejemplo n.º 1
0
function shoestrap_footer_css()
{
    $footer_color = get_theme_mod('shoestrap_footer_background_color');
    // Make sure colors are properly formatted
    $footer_color = '#' . str_replace('#', '', $footer_color);
    ?>
  
  <style>
    #footer-wrapper{ background: <?php 
    echo $footer_color;
    ?>
 }
    <?php 
    if (shoestrap_get_brightness($footer_color) >= 160) {
        ?>
      #footer-wrapper{ color: <?php 
        echo shoestrap_adjust_brightness($footer_color, -150);
        ?>
; }
      #footer-wrapper a{ color: <?php 
        echo shoestrap_adjust_brightness($footer_color, -180);
        ?>
;}
    <?php 
    } else {
        ?>
      #footer-wrapper{ color: <?php 
        echo shoestrap_adjust_brightness($footer_color, 150);
        ?>
;}
      #footer-wrapper a{color: <?php 
        echo shoestrap_adjust_brightness($footer_color, 180);
        ?>
;}
    <?php 
    }
    ?>
  </style>
  <?php 
}
Ejemplo n.º 2
0
function shoestrap_navbar_css()
{
    $header_bg_color = get_theme_mod('shoestrap_header_backgroundcolor');
    $navbar_color = get_theme_mod('shoestrap_navbar_color');
    // Make sure colors are properly formatted
    $header_bg_color = '#' . str_replace('#', '', $header_bg_color);
    $navbar_color = '#' . str_replace('#', '', $navbar_color);
    ?>

  <style>
    <?php 
    if (get_theme_mod('shoestrap_logo')) {
        if (get_theme_mod('shoestrap_header_mode') == 'navbar') {
            ?>
        .navbar a.brand{padding: 5px 20px 5px;}
    <?php 
        }
    }
    ?>
    .navbar-inner, .navbar-inner ul.dropdown-menu, #main-subnav.subnav-fixed{
      background-color: <?php 
    echo $navbar_color;
    ?>
 !important;
      background-image: -moz-linear-gradient(top, <?php 
    echo $navbar_color;
    ?>
, <?php 
    echo shoestrap_adjust_brightness($navbar_color, -10);
    ?>
) !important;
      background-image: -webkit-gradient(linear, 0 0, 0 100%, from(<?php 
    echo $navbar_color;
    ?>
), to(<?php 
    echo shoestrap_adjust_brightness($navbar_color, -10);
    ?>
)) !important;
      background-image: -webkit-linear-gradient(top, <?php 
    echo $navbar_color;
    ?>
, <?php 
    echo shoestrap_adjust_brightness($navbar_color, -10);
    ?>
) !important;
      background-image: -o-linear-gradient(top, <?php 
    echo $navbar_color;
    ?>
, <?php 
    echo shoestrap_adjust_brightness($navbar_color, -10);
    ?>
) !important;
      background-image: linear-gradient(to bottom, <?php 
    echo $navbar_color;
    ?>
, <?php 
    echo shoestrap_adjust_brightness($navbar_color, -10);
    ?>
) !important;
      filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(<?php 
    echo $navbar_color;
    ?>
),argb(<?php 
    echo shoestrap_adjust_brightness($navbar_color, -10);
    ?>
))) !important;
      border: 1px solid <?php 
    echo shoestrap_adjust_brightness($navbar_color, -20);
    ?>
;
    }
    .navbar .nav > li > .dropdown-menu::before{
      border-bottom: 7px solid <?php 
    echo $navbar_color;
    ?>
;
    }
    .navbar .nav > li > .dropdown-menu::after{
      border-bottom: 6px solid <?php 
    echo $navbar_color;
    ?>
;
    }
    .btn.btn-navbar{
      <?php 
    if (shoestrap_get_brightness($navbar_color) >= 160) {
        ?>
        background: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -40);
        ?>
;
      <?php 
    } else {
        ?>
        background: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 40);
        ?>
;
      <?php 
    }
    ?>
    }
    .btn.btn-navbar:hover, .btn.btn-navbar:active, .btn.btn-navbar:enabled{
      <?php 
    if (shoestrap_get_brightness($navbar_color) >= 160) {
        ?>
        background: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -30);
        ?>
;
      <?php 
    } else {
        ?>
        background: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 30);
        ?>
;
      <?php 
    }
    ?>
    }
    .navbar-inner a, .navbar-inner .brand, .navbar .nav > li > a,
    .navbar-inner .dropdown-menu li > a,
    .navbar-inner .dropdown-menu li > a:hover, .navbar-inner .dropdown-menu li > a:focus, .navbar-inner .dropdown-submenu:hover > a{
      <?php 
    if (shoestrap_get_brightness($navbar_color) >= 160) {
        ?>
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -160);
        ?>
;
      <?php 
    } else {
        ?>
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 160);
        ?>
;
      <?php 
    }
    ?>
      text-shadow: 0 1px 0 <?php 
    echo shoestrap_adjust_brightness($navbar_color, -15);
    ?>
;
    }
    .navbar-inner a:hover, .navbar-inner .brand:hover, .navbar .nav > li > a:hover{
      <?php 
    if (shoestrap_get_brightness($navbar_color) >= 160) {
        ?>
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -200);
        ?>
;
      <?php 
    } else {
        ?>
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 200);
        ?>
;
      <?php 
    }
    ?>
      text-shadow: 0 1px 0 <?php 
    echo shoestrap_adjust_brightness($navbar_color, -15);
    ?>
;
    }
    .navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus{
      <?php 
    if (shoestrap_get_brightness($navbar_color) >= 130) {
        ?>
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -180);
        ?>
;
        background-color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -20);
        ?>
;
      <?php 
    } else {
        ?>
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 180);
        ?>
;
        background-color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 30);
        ?>
;
      <?php 
    }
    ?>
      text-shadow: 0 1px 0 <?php 
    echo shoestrap_adjust_brightness($navbar_color, -15);
    ?>
;
    }
    .navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.active > .dropdown-toggle, .navbar .nav li.dropdown.open.active > .dropdown-toggle{
      <?php 
    if (shoestrap_get_brightness($navbar_color) >= 130) {
        ?>
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -180);
        ?>
;
        background-color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -40);
        ?>
;
      <?php 
    } else {
        ?>
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 180);
        ?>
;
        background-color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 50);
        ?>
;
      <?php 
    }
    ?>
      text-shadow: 0 1px 0 <?php 
    echo shoestrap_adjust_brightness($navbar_color, -15);
    ?>
;
    }
    .navbar .nav li.dropdown > .dropdown-toggle .caret,
    .navbar .nav li.dropdown.open > .dropdown-toggle .caret, .navbar .nav li.dropdown.active > .dropdown-toggle .caret, 
    .navbar .nav li.dropdown.open.active > .dropdown-toggle .caret{
      <?php 
    if (shoestrap_get_brightness($navbar_color) >= 160) {
        ?>
        border-top-color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -160);
        ?>
;
        border-bottom-color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -160);
        ?>
;
      <?php 
    } else {
        ?>
        border-top-color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 160);
        ?>
;
        border-bottom-color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 160);
        ?>
;
      <?php 
    }
    ?>
    }
    .dropdown-menu .active > a, .dropdown-menu .active > a:hover{
      <?php 
    if (shoestrap_get_brightness($navbar_color) >= 160) {
        ?>
        background: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -100);
        ?>
;
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 10);
        ?>
 !important;
      <?php 
    } else {
        ?>
        background: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 100);
        ?>
;
        color: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -10);
        ?>
 !important;
      <?php 
    }
    ?>
    }
    .dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a{
      <?php 
    if (shoestrap_get_brightness($navbar_color) >= 160) {
        ?>
        background: <?php 
        echo shoestrap_adjust_brightness($navbar_color, -30);
        ?>
;
      <?php 
    } else {
        ?>
        background: <?php 
        echo shoestrap_adjust_brightness($navbar_color, 30);
        ?>
;
      <?php 
    }
    ?>
    }
    <?php 
    if (shoestrap_get_brightness($header_bg_color) >= 130) {
        ?>
      .dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a{color: #222;}
    <?php 
    }
    ?>

  </style>
  <?php 
}
Ejemplo n.º 3
0
function shoestrap_social_share_styles()
{
    $googleplus = get_theme_mod('shoestrap_gplus_on_posts');
    $facebook = get_theme_mod('shoestrap_facebook_on_posts');
    $twitter = get_theme_mod('shoestrap_twitter_on_posts');
    $linkedin = get_theme_mod('shoestrap_linkedin_on_posts');
    $pinterest = get_theme_mod('shoestrap_pinterest_on_posts');
    // The number of networks.
    $networks_nr = $googleplus + $facebook + $twitter + $linkedin + $pinterest;
    $btn_color = get_theme_mod('shoestrap_buttons_color');
    // Make sure colors are properly formatted
    $btn_color = '#' . str_replace('#', '', $btn_color);
    // if no color has been selected, set to #0066cc. This prevents errors with the php-less compiler.
    if (strlen($btn_color) < 3) {
        $btn_color = '#0066cc';
    }
    ?>

  <style type="text/css">
    .sharrre .box{
      height:22px;
      display:inline-block;
      position:relative;
      padding:0px 55px 0 8px;
      -webkit-border-radius:4px;
      -moz-border-radius:4px;
      border-radius:4px;
      font-size:12px;
      float:left;
      clear:both;
      overflow:hidden;
      -webkit-transition:all 0.3s linear;
      -moz-transition:all 0.3s linear;
      -o-transition:all 0.3s linear;
      transition:all 0.3s linear;
    }
    .sharrre .left{
      line-height:22px;
      display:block;
      white-space:nowrap;
      text-shadow:0px 1px 1px rgba(255,255,255,0.3);
      -webkit-transition:all 0.2s linear;
      -moz-transition:all 0.2s linear;
      -o-transition:all 0.2s linear;
      transition:all 0.2s linear;
    }
    .sharrre .middle{
      position:absolute;
      height:22px;
      top:0px;
      right:30px;
      width:0px;
      white-space:nowrap;
      text-align:left;
      overflow:hidden;
      -webkit-box-shadow:-1px 0px 1px rgba(255,255,255,0.4), 1px 1px 2px rgba(0,0,0,0.2) inset;
      -moz-box-shadow:-1px 0px 1px rgba(255,255,255,0.4), 1px 1px 2px rgba(0,0,0,0.2) inset;
      box-shadow:-1px 0px 1px rgba(255,255,255,0.4), 1px 1px 2px rgba(0,0,0,0.2) inset;
      -webkit-transition:width 0.3s linear;
      -moz-transition:width 0.3s linear;
      -o-transition:width 0.3s linear;
      transition:width 0.3s linear;
    }
    .sharrre .middle a{
      font-weight:bold;
      padding:0 9px 0 9px;
      text-align:center;
      float:left;
      line-height:22px;
      -webkit-box-shadow:-1px 0px 1px rgba(255,255,255,0.4), 1px 1px 2px rgba(0,0,0,0.2) inset;
      -moz-box-shadow:-1px 0px 1px rgba(255,255,255,0.4), 1px 1px 2px rgba(0,0,0,0.2) inset;
      box-shadow:-1px 0px 1px rgba(255,255,255,0.4), 1px 1px 2px rgba(0,0,0,0.2) inset;
    }
    .sharrre .right{
      position:absolute;
      right:0px;
      top:0px;
      height:100%;
      width:45px;
      text-align:center;
      line-height:22px;
    }
    .sharrre .box:hover{
      padding-right:<?php 
    echo $networks_nr * 30 + 40;
    ?>
px;
    }
    .sharrre .middle a:hover{
      text-decoration:none;
    }
    .sharrre .box:hover .middle{
      width:<?php 
    echo $networks_nr * 30;
    ?>
px;
    }
    <?php 
    if (shoestrap_get_brightness($btn_color) >= 160) {
        ?>
      .sharrre, .sharrre .middle a{color: #333;}
      .sharrre .middle{
        background: <?php 
        echo shoestrap_adjust_brightness($btn_color, -10);
        ?>
;
      }
      .sharrre .right{
        background: <?php 
        echo shoestrap_adjust_brightness($btn_color, -150);
        ?>
;
        color: <?php 
        echo shoestrap_adjust_brightness($btn_color, 20);
        ?>
;
      }
    <?php 
    } else {
        ?>
      .sharrre, .sharrre .middle a{color: #fff;}
      .sharrre .middle{
        background: <?php 
        echo shoestrap_adjust_brightness($btn_color, 10);
        ?>
;
      }
      .sharrre .right{
        background: <?php 
        echo shoestrap_adjust_brightness($btn_color, 150);
        ?>
;
        color: <?php 
        echo shoestrap_adjust_brightness($btn_color, -20);
        ?>
;
      }
    <?php 
    }
    ?>
    <?php 
    if (class_exists('lessc')) {
        $less = new lessc();
        $less->setVariables(array("btnColor" => $btn_color));
        $less->setFormatter("compressed");
        if (shoestrap_get_brightness($btn_color) <= 160) {
            // The code below is a copied from bootstrap's buttons.less + mixins.less files
            echo $less->compile("\n          @btnColorHighlight: darken(spin(@btnColor, 5%), 10%);\n  \n          .gradientBar(@primaryColor, @secondaryColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {\n            color: @textColor;\n            text-shadow: @textShadow;\n            #gradient > .vertical(@primaryColor, @secondaryColor);\n            border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);\n            border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);\n          }\n  \n          #gradient {\n            .vertical(@startColor: #555, @endColor: #333) {\n              background-color: mix(@startColor, @endColor, 60%);\n              background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+\n              background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+\n              background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+\n              background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10\n              background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10\n              background-repeat: repeat-x;\n            }\n          }\n  \n          .buttonBackground(@startColor, @endColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {\n            .gradientBar(@startColor, @endColor, @textColor, @textShadow);\n            *background-color: @endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */\n            .reset-filter();\n            &:hover, &:active, &.active, &.disabled, &[disabled] {\n              color: @textColor;\n              background-color: @endColor;\n              *background-color: darken(@endColor, 5%);\n            }\n          }\n          .sharrre .box{\n            .buttonBackground(@btnColor, @btnColorHighlight);\n          }\n        ");
        } else {
            echo $less->compile("\n          @btnColorHighlight: darken(@btnColor, 15%);\n  \n          .gradientBar(@primaryColor, @secondaryColor, @textColor: #333, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {\n            color: @textColor;\n            text-shadow: @textShadow;\n            #gradient > .vertical(@primaryColor, @secondaryColor);\n            border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);\n            border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);\n          }\n  \n          #gradient {\n            .vertical(@startColor: #555, @endColor: #333) {\n              background-color: mix(@startColor, @endColor, 60%);\n              background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+\n              background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+\n              background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+\n              background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10\n              background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10\n              background-repeat: repeat-x;\n            }\n          }\n  \n          .buttonBackground(@startColor, @endColor, @textColor: #333, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {\n            .gradientBar(@startColor, @endColor, @textColor, @textShadow);\n            *background-color: @endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */\n            .reset-filter();\n            &:hover, &:active, &.active, &.disabled, &[disabled] {\n              color: @textColor;\n              background-color: @endColor;\n              *background-color: darken(@endColor, 5%);\n            }\n          }\n          .sharrre .box{\n            .buttonBackground(@btnColor, @btnColorHighlight);\n          }\n        ");
        }
    }
    ?>
  </style>
  <?php 
}