jasonbrooks / centos / centos.org

Forked from centos/centos.org 5 years ago
Clone

Blame _sass/bootstrap/_mixins.scss

e8ec7a
//
e8ec7a
// Mixins
e8ec7a
// --------------------------------------------------
e8ec7a
e8ec7a
e8ec7a
// Utilities
e8ec7a
// -------------------------
e8ec7a
e8ec7a
// Clearfix
e8ec7a
// Source: http://nicolasgallagher.com/micro-clearfix-hack/
e8ec7a
//
e8ec7a
// For modern browsers
e8ec7a
// 1. The space content is one way to avoid an Opera bug when the
e8ec7a
//    contenteditable attribute is included anywhere else in the document.
e8ec7a
//    Otherwise it causes space to appear at the top and bottom of elements
e8ec7a
//    that are clearfixed.
e8ec7a
// 2. The use of `table` rather than `block` is only necessary if using
e8ec7a
//    `:before` to contain the top-margins of child elements.
e8ec7a
@mixin clearfix() {
e8ec7a
  &:before,
e8ec7a
  &:after {
e8ec7a
    content: " "; /* 1 */
e8ec7a
    display: table; /* 2 */
e8ec7a
  }
e8ec7a
  &:after {
e8ec7a
    clear: both;
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Webkit-style focus
e8ec7a
@mixin tab-focus() {
e8ec7a
  // Default
e8ec7a
  outline: thin dotted #333;
e8ec7a
  // Webkit
e8ec7a
  outline: 5px auto -webkit-focus-ring-color;
e8ec7a
  outline-offset: -2px;
e8ec7a
}
e8ec7a
e8ec7a
// Center-align a block level element
e8ec7a
@mixin center-block() {
e8ec7a
  display: block;
e8ec7a
  margin-left: auto;
e8ec7a
  margin-right: auto;
e8ec7a
}
e8ec7a
e8ec7a
// Sizing shortcuts
e8ec7a
@mixin size($width, $height) {
e8ec7a
  width: $width;
e8ec7a
  height: $height;
e8ec7a
}
e8ec7a
@mixin square($size) {
e8ec7a
  @include size($size, $size);
e8ec7a
}
e8ec7a
e8ec7a
// Placeholder text
e8ec7a
@mixin placeholder($color: $input-color-placeholder) {
e8ec7a
  &:-moz-placeholder            { color: $color; } // Firefox 4-18
e8ec7a
  &::-moz-placeholder           { color: $color; } // Firefox 19+
e8ec7a
  &:-ms-input-placeholder       { color: $color; } // Internet Explorer 10+
e8ec7a
  &::-webkit-input-placeholder  { color: $color; } // Safari and Chrome
e8ec7a
}
e8ec7a
e8ec7a
// Text overflow
e8ec7a
// Requires inline-block or block for proper styling
e8ec7a
@mixin text-overflow() {
e8ec7a
  overflow: hidden;
e8ec7a
  text-overflow: ellipsis;
e8ec7a
  white-space: nowrap;
e8ec7a
}
e8ec7a
e8ec7a
// CSS image replacement
e8ec7a
// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
e8ec7a
@mixin hide-text() {
e8ec7a
  font: #{0/0} a;
e8ec7a
  color: transparent;
e8ec7a
  text-shadow: none;
e8ec7a
  background-color: transparent;
e8ec7a
  border: 0;
e8ec7a
}
e8ec7a
e8ec7a
e8ec7a
e8ec7a
// CSS3 PROPERTIES
e8ec7a
// --------------------------------------------------
e8ec7a
e8ec7a
// Single side border-radius
e8ec7a
@mixin border-top-radius($radius) {
e8ec7a
  border-top-right-radius: $radius;
e8ec7a
   border-top-left-radius: $radius;
e8ec7a
}
e8ec7a
@mixin border-right-radius($radius) {
e8ec7a
  border-bottom-right-radius: $radius;
e8ec7a
     border-top-right-radius: $radius;
e8ec7a
}
e8ec7a
@mixin border-bottom-radius($radius) {
e8ec7a
  border-bottom-right-radius: $radius;
e8ec7a
   border-bottom-left-radius: $radius;
e8ec7a
}
e8ec7a
@mixin border-left-radius($radius) {
e8ec7a
  border-bottom-left-radius: $radius;
e8ec7a
     border-top-left-radius: $radius;
e8ec7a
}
e8ec7a
e8ec7a
// Drop shadows
e8ec7a
@mixin box-shadow($shadow...) {
e8ec7a
  -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
e8ec7a
          box-shadow: $shadow;
e8ec7a
}
e8ec7a
e8ec7a
// Transitions
e8ec7a
@mixin transition($transition...) {
e8ec7a
  -webkit-transition: $transition;
e8ec7a
          transition: $transition;
e8ec7a
}
e8ec7a
@mixin transition-delay($transition-delay) {
e8ec7a
  -webkit-transition-delay: $transition-delay;
e8ec7a
          transition-delay: $transition-delay;
e8ec7a
}
e8ec7a
@mixin transition-duration($transition-duration) {
e8ec7a
  -webkit-transition-duration: $transition-duration;
e8ec7a
          transition-duration: $transition-duration;
e8ec7a
}
e8ec7a
@mixin transition-transform($transition...) {
e8ec7a
  -webkit-transition: -webkit-transform $transition;
e8ec7a
     -moz-transition: -moz-transform $transition;
e8ec7a
       -o-transition: -o-transform $transition;
e8ec7a
          transition: transform $transition;
e8ec7a
}
e8ec7a
e8ec7a
// Transformations
e8ec7a
@mixin rotate($degrees) {
e8ec7a
  -webkit-transform: rotate($degrees);
e8ec7a
      -ms-transform: rotate($degrees); // IE9+
e8ec7a
          transform: rotate($degrees);
e8ec7a
}
e8ec7a
@mixin scale($ratio) {
e8ec7a
  -webkit-transform: scale($ratio);
e8ec7a
      -ms-transform: scale($ratio); // IE9+
e8ec7a
          transform: scale($ratio);
e8ec7a
}
e8ec7a
@mixin translate($x, $y) {
e8ec7a
  -webkit-transform: translate($x, $y);
e8ec7a
      -ms-transform: translate($x, $y); // IE9+
e8ec7a
          transform: translate($x, $y);
e8ec7a
}
e8ec7a
@mixin skew($x, $y) {
e8ec7a
  -webkit-transform: skew($x, $y);
e8ec7a
      -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
e8ec7a
          transform: skew($x, $y);
e8ec7a
}
e8ec7a
@mixin translate3d($x, $y, $z) {
e8ec7a
  -webkit-transform: translate3d($x, $y, $z);
e8ec7a
          transform: translate3d($x, $y, $z);
e8ec7a
}
e8ec7a
e8ec7a
// Backface visibility
e8ec7a
// Prevent browsers from flickering when using CSS 3D transforms.
e8ec7a
// Default value is `visible`, but can be changed to `hidden`
e8ec7a
// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
e8ec7a
@mixin backface-visibility($visibility){
e8ec7a
  -webkit-backface-visibility: $visibility;
e8ec7a
     -moz-backface-visibility: $visibility;
e8ec7a
          backface-visibility: $visibility;
e8ec7a
}
e8ec7a
e8ec7a
// Box sizing
e8ec7a
@mixin box-sizing($boxmodel) {
e8ec7a
  -webkit-box-sizing: $boxmodel;
e8ec7a
     -moz-box-sizing: $boxmodel;
e8ec7a
          box-sizing: $boxmodel;
e8ec7a
}
e8ec7a
e8ec7a
// User select
e8ec7a
// For selecting text on the page
e8ec7a
@mixin user-select($select) {
e8ec7a
  -webkit-user-select: $select;
e8ec7a
     -moz-user-select: $select;
e8ec7a
      -ms-user-select: $select; // IE10+
e8ec7a
       -o-user-select: $select;
e8ec7a
          user-select: $select;
e8ec7a
}
e8ec7a
e8ec7a
// Resize anything
e8ec7a
@mixin resizable($direction) {
e8ec7a
  resize: $direction; // Options: horizontal, vertical, both
e8ec7a
  overflow: auto; // Safari fix
e8ec7a
}
e8ec7a
e8ec7a
// CSS3 Content Columns
e8ec7a
@mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
e8ec7a
  -webkit-column-count: $column-count;
e8ec7a
     -moz-column-count: $column-count;
e8ec7a
          column-count: $column-count;
e8ec7a
  -webkit-column-gap: $column-gap;
e8ec7a
     -moz-column-gap: $column-gap;
e8ec7a
          column-gap: $column-gap;
e8ec7a
}
e8ec7a
e8ec7a
// Optional hyphenation
e8ec7a
@mixin hyphens($mode: auto) {
e8ec7a
  word-wrap: break-word;
e8ec7a
  -webkit-hyphens: $mode;
e8ec7a
     -moz-hyphens: $mode;
e8ec7a
      -ms-hyphens: $mode; // IE10+
e8ec7a
       -o-hyphens: $mode;
e8ec7a
          hyphens: $mode;
e8ec7a
}
e8ec7a
e8ec7a
// Opacity
e8ec7a
@mixin opacity($opacity) {
e8ec7a
  opacity: $opacity;
e8ec7a
  // IE8 filter
e8ec7a
  $opacity-ie: ($opacity * 100);
e8ec7a
  filter: #{alpha(opacity=$opacity-ie)};
e8ec7a
}
e8ec7a
e8ec7a
e8ec7a
e8ec7a
// GRADIENTS
e8ec7a
// --------------------------------------------------
e8ec7a
e8ec7a
e8ec7a
e8ec7a
// Horizontal gradient, from left to right
e8ec7a
//
e8ec7a
// Creates two color stops, start and end, by specifying a color and position for each color stop.
e8ec7a
// Color stops are not available in IE9 and below.
e8ec7a
@mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
e8ec7a
  background-image: -webkit-gradient(linear, $start-percent top, $end-percent top, from($start-color), to($end-color)); // Safari 4+, Chrome 2+
e8ec7a
  background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1+, Chrome 10+
e8ec7a
  background-image: -moz-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
e8ec7a
  background-image:  linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
e8ec7a
  background-repeat: repeat-x;
e8ec7a
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
e8ec7a
}
e8ec7a
e8ec7a
// Vertical gradient, from top to bottom
e8ec7a
//
e8ec7a
// Creates two color stops, start and end, by specifying a color and position for each color stop.
e8ec7a
// Color stops are not available in IE9 and below.
e8ec7a
@mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
e8ec7a
  background-image: -webkit-gradient(linear, left $start-percent, left $end-percent, from($start-color), to($end-color)); // Safari 4+, Chrome 2+
e8ec7a
  background-image: -webkit-linear-gradient(top, $start-color, $start-percent, $end-color, $end-percent); // Safari 5.1+, Chrome 10+
e8ec7a
  background-image:  -moz-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
e8ec7a
  background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
e8ec7a
  background-repeat: repeat-x;
e8ec7a
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
e8ec7a
}
e8ec7a
e8ec7a
@mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
e8ec7a
  background-repeat: repeat-x;
e8ec7a
  background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1+, Chrome 10+
e8ec7a
  background-image: -moz-linear-gradient($deg, $start-color, $end-color); // FF 3.6+
e8ec7a
  background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10
e8ec7a
}
e8ec7a
@mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
e8ec7a
  background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color));
e8ec7a
  background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
e8ec7a
  background-image: -moz-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
e8ec7a
  background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
e8ec7a
  background-repeat: no-repeat;
e8ec7a
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback
e8ec7a
}
e8ec7a
@mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
e8ec7a
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color));
e8ec7a
  background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color);
e8ec7a
  background-image: -moz-linear-gradient(top, $start-color, $mid-color $color-stop, $end-color);
e8ec7a
  background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
e8ec7a
  background-repeat: no-repeat;
e8ec7a
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
e8ec7a
}
e8ec7a
@mixin gradient-radial($inner-color: #555, $outer-color: #333) {
e8ec7a
  background-image: -webkit-gradient(radial, center center, 0, center center, 460, from($inner-color), to($outer-color));
e8ec7a
  background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color);
e8ec7a
  background-image: -moz-radial-gradient(circle, $inner-color, $outer-color);
e8ec7a
  background-image: radial-gradient(circle, $inner-color, $outer-color);
e8ec7a
  background-repeat: no-repeat;
e8ec7a
}
e8ec7a
@mixin gradient-striped($color: #555, $angle: 45deg) {
e8ec7a
  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
e8ec7a
  background-image: -webkit-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
e8ec7a
  background-image: -moz-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
e8ec7a
  background-image: linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
e8ec7a
}
e8ec7a
e8ec7a
// Reset filters for IE
e8ec7a
//
e8ec7a
// When you need to remove a gradient background, do not forget to use this to reset
e8ec7a
// the IE filter for IE9 and below.
e8ec7a
@mixin reset-filter() {
e8ec7a
  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
e8ec7a
}
e8ec7a
e8ec7a
e8ec7a
e8ec7a
// Retina images
e8ec7a
//
e8ec7a
// Short retina mixin for setting background-image and -size
e8ec7a
e8ec7a
@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
e8ec7a
  background-image: image-url("#{$file-1x}");
e8ec7a
e8ec7a
  @media
e8ec7a
  only screen and (-webkit-min-device-pixel-ratio: 2),
e8ec7a
  only screen and (   min--moz-device-pixel-ratio: 2),
e8ec7a
  only screen and (     -o-min-device-pixel-ratio: 2/1),
e8ec7a
  only screen and (        min-device-pixel-ratio: 2),
e8ec7a
  only screen and (                min-resolution: 192dpi),
e8ec7a
  only screen and (                min-resolution: 2dppx) {
e8ec7a
    background-image: image-url("#{$file-2x}");
e8ec7a
    background-size: $width-1x $height-1x;
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
e8ec7a
// Responsive image
e8ec7a
//
e8ec7a
// Keep images from scaling beyond the width of their parents.
e8ec7a
e8ec7a
@mixin img-responsive($display: block) {
e8ec7a
  display: $display;
e8ec7a
  max-width: 100%; // Part 1: Set a maximum relative to the parent
e8ec7a
  height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
e8ec7a
}
e8ec7a
e8ec7a
e8ec7a
// COMPONENT MIXINS
e8ec7a
// --------------------------------------------------
e8ec7a
e8ec7a
// Horizontal dividers
e8ec7a
// -------------------------
e8ec7a
// Dividers (basically an hr) within dropdowns and nav lists
e8ec7a
@mixin nav-divider($color: #e5e5e5) {
e8ec7a
  height: 1px;
e8ec7a
  margin: (($line-height-computed / 2) - 1) 0;
e8ec7a
  overflow: hidden;
e8ec7a
  background-color: $color;
e8ec7a
}
e8ec7a
e8ec7a
// Panels
e8ec7a
// -------------------------
e8ec7a
@mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) {
e8ec7a
  border-color: $border;
e8ec7a
  & > .panel-heading {
e8ec7a
    color: $heading-text-color;
e8ec7a
    background-color: $heading-bg-color;
e8ec7a
    border-color: $heading-border;
e8ec7a
    + .panel-collapse .panel-body {
e8ec7a
      border-top-color: $border;
e8ec7a
    }
e8ec7a
  }
e8ec7a
  & > .panel-footer {
e8ec7a
    + .panel-collapse .panel-body {
e8ec7a
      border-bottom-color: $border;
e8ec7a
    }
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Alerts
e8ec7a
// -------------------------
e8ec7a
@mixin alert-variant($background, $border, $text-color) {
e8ec7a
  background-color: $background;
e8ec7a
  border-color: $border;
e8ec7a
  color: $text-color;
e8ec7a
  hr {
e8ec7a
    border-top-color: darken($border, 5%);
e8ec7a
  }
e8ec7a
  .alert-link {
e8ec7a
    color: darken($text-color, 10%);
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Tables
e8ec7a
// -------------------------
e8ec7a
@mixin table-row-variant($state, $background, $border) {
e8ec7a
  // Exact selectors below required to override `.table-striped` and prevent
e8ec7a
  // inheritance to nested tables.
e8ec7a
  .table > thead > tr,
e8ec7a
  .table > tbody > tr,
e8ec7a
  .table > tfoot > tr {
e8ec7a
    > td.#{$state},
e8ec7a
    > th.#{$state},
e8ec7a
    &.#{$state} > td,
e8ec7a
    &.#{$state} > th {
e8ec7a
      background-color: $background;
e8ec7a
      border-color: $border;
e8ec7a
    }
e8ec7a
  }
e8ec7a
e8ec7a
  // Hover states for `.table-hover`
e8ec7a
  // Note: this is not available for cells or rows within `thead` or `tfoot`.
e8ec7a
  .table-hover > tbody > tr {
e8ec7a
    > td.#{$state}:hover,
e8ec7a
    > th.#{$state}:hover,
e8ec7a
    &.#{$state}:hover > td {
e8ec7a
      background-color: darken($background, 5%);
e8ec7a
      border-color: darken($border, 5%);
e8ec7a
    }
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Button variants
e8ec7a
// -------------------------
e8ec7a
// Easily pump out default styles, as well as :hover, :focus, :active,
e8ec7a
// and disabled options for all buttons
e8ec7a
@mixin button-variant($color, $background, $border) {
e8ec7a
  color: $color;
e8ec7a
  background-color: $background;
e8ec7a
  border-color: $border;
e8ec7a
e8ec7a
  &:hover,
e8ec7a
  &:focus,
e8ec7a
  &:active,
e8ec7a
  &.active {
e8ec7a
    color: $color;
e8ec7a
    background-color: darken($background, 8%);
e8ec7a
        border-color: darken($border, 12%);
e8ec7a
  }
e8ec7a
  .open & { &.dropdown-toggle {
e8ec7a
    color: $color;
e8ec7a
    background-color: darken($background, 8%);
e8ec7a
        border-color: darken($border, 12%);
e8ec7a
  } }
e8ec7a
  &:active,
e8ec7a
  &.active {
e8ec7a
    background-image: none;
e8ec7a
  }
e8ec7a
  .open & { &.dropdown-toggle {
e8ec7a
    background-image: none;
e8ec7a
  } }
e8ec7a
  &.disabled,
e8ec7a
  &[disabled],
e8ec7a
  fieldset[disabled] & {
e8ec7a
    &,
e8ec7a
    &:hover,
e8ec7a
    &:focus,
e8ec7a
    &:active,
e8ec7a
    &.active {
e8ec7a
      background-color: $background;
e8ec7a
          border-color: $border
e8ec7a
    }
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Button sizes
e8ec7a
// -------------------------
e8ec7a
@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
e8ec7a
  padding: $padding-vertical $padding-horizontal;
e8ec7a
  font-size: $font-size;
e8ec7a
  line-height: $line-height;
e8ec7a
  border-radius: $border-radius;
e8ec7a
}
e8ec7a
e8ec7a
// Pagination
e8ec7a
// -------------------------
e8ec7a
@mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $border-radius) {
e8ec7a
  > li {
e8ec7a
    > a,
e8ec7a
    > span {
e8ec7a
      padding: $padding-vertical $padding-horizontal;
e8ec7a
      font-size: $font-size;
e8ec7a
    }
e8ec7a
    &:first-child {
e8ec7a
      > a,
e8ec7a
      > span {
e8ec7a
        @include border-left-radius($border-radius);
e8ec7a
      }
e8ec7a
    }
e8ec7a
    &:last-child {
e8ec7a
      > a,
e8ec7a
      > span {
e8ec7a
        @include border-right-radius($border-radius);
e8ec7a
      }
e8ec7a
    }
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Labels
e8ec7a
// -------------------------
e8ec7a
@mixin label-variant($color) {
e8ec7a
  background-color: $color;
e8ec7a
  &[href] {
e8ec7a
    &:hover,
e8ec7a
    &:focus {
e8ec7a
      background-color: darken($color, 10%);
e8ec7a
    }
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Navbar vertical align
e8ec7a
// -------------------------
e8ec7a
// Vertically center elements in the navbar.
e8ec7a
// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
e8ec7a
@mixin navbar-vertical-align($element-height) {
e8ec7a
  margin-top: (($navbar-height - $element-height) / 2);
e8ec7a
  margin-bottom: (($navbar-height - $element-height) / 2);
e8ec7a
}
e8ec7a
e8ec7a
// Progress bars
e8ec7a
// -------------------------
e8ec7a
@mixin progress-bar-variant($color) {
e8ec7a
  background-color: $color;
e8ec7a
  .progress-striped & {
e8ec7a
    @include gradient-striped($color);
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Responsive utilities
e8ec7a
// -------------------------
e8ec7a
// More easily include all the states for responsive-utilities.less.
e8ec7a
// [converter] $parent hack
e8ec7a
@mixin responsive-visibility($parent) {
e8ec7a
  #{$parent} { display: block !important; }
e8ec7a
  tr#{$parent} { display: table-row !important; }
e8ec7a
  th#{$parent},
e8ec7a
  td#{$parent} { display: table-cell !important; }
e8ec7a
}
e8ec7a
e8ec7a
// [converter] $parent hack
e8ec7a
@mixin responsive-invisibility($parent) {
e8ec7a
  #{$parent} { display: none !important; }
e8ec7a
  tr#{$parent} { display: none !important; }
e8ec7a
  th#{$parent},
e8ec7a
  td#{$parent} { display: none !important; }
e8ec7a
}
e8ec7a
e8ec7a
// Grid System
e8ec7a
// -----------
e8ec7a
e8ec7a
// Centered container element
e8ec7a
@mixin container-fixed() {
e8ec7a
  margin-right: auto;
e8ec7a
  margin-left: auto;
e8ec7a
  padding-left:  ($grid-gutter-width / 2);
e8ec7a
  padding-right: ($grid-gutter-width / 2);
e8ec7a
  @include clearfix();
e8ec7a
}
e8ec7a
e8ec7a
// Creates a wrapper for a series of columns
e8ec7a
@mixin make-row($gutter: $grid-gutter-width) {
e8ec7a
  margin-left:  ($gutter / -2);
e8ec7a
  margin-right: ($gutter / -2);
e8ec7a
  @include clearfix();
e8ec7a
}
e8ec7a
e8ec7a
// Generate the extra small columns
e8ec7a
@mixin make-xs-column($columns, $gutter: $grid-gutter-width) {
e8ec7a
  position: relative;
e8ec7a
  float: left;
e8ec7a
  width: percentage(($columns / $grid-columns));
e8ec7a
  // Prevent columns from collapsing when empty
e8ec7a
  min-height: 1px;
e8ec7a
  // Inner gutter via padding
e8ec7a
  padding-left:  ($gutter / 2);
e8ec7a
  padding-right: ($gutter / 2);
e8ec7a
}
e8ec7a
e8ec7a
// Generate the small columns
e8ec7a
@mixin make-sm-column($columns, $gutter: $grid-gutter-width) {
e8ec7a
  position: relative;
e8ec7a
  // Prevent columns from collapsing when empty
e8ec7a
  min-height: 1px;
e8ec7a
  // Inner gutter via padding
e8ec7a
  padding-left:  ($gutter / 2);
e8ec7a
  padding-right: ($gutter / 2);
e8ec7a
e8ec7a
  // Calculate width based on number of columns available
e8ec7a
  @media (min-width: $screen-sm) {
e8ec7a
    float: left;
e8ec7a
    width: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Generate the small column offsets
e8ec7a
@mixin make-sm-column-offset($columns) {
e8ec7a
  @media (min-width: $screen-sm) {
e8ec7a
    margin-left: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
@mixin make-sm-column-push($columns) {
e8ec7a
  @media (min-width: $screen-sm) {
e8ec7a
    left: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
@mixin make-sm-column-pull($columns) {
e8ec7a
  @media (min-width: $screen-sm) {
e8ec7a
    right: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Generate the medium columns
e8ec7a
@mixin make-md-column($columns, $gutter: $grid-gutter-width) {
e8ec7a
  position: relative;
e8ec7a
  // Prevent columns from collapsing when empty
e8ec7a
  min-height: 1px;
e8ec7a
  // Inner gutter via padding
e8ec7a
  padding-left:  ($gutter / 2);
e8ec7a
  padding-right: ($gutter / 2);
e8ec7a
e8ec7a
  // Calculate width based on number of columns available
e8ec7a
  @media (min-width: $screen-md) {
e8ec7a
    float: left;
e8ec7a
    width: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Generate the large column offsets
e8ec7a
@mixin make-md-column-offset($columns) {
e8ec7a
  @media (min-width: $screen-md) {
e8ec7a
    margin-left: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
@mixin make-md-column-push($columns) {
e8ec7a
  @media (min-width: $screen-md) {
e8ec7a
    left: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
@mixin make-md-column-pull($columns) {
e8ec7a
  @media (min-width: $screen-md) {
e8ec7a
    right: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Generate the large columns
e8ec7a
@mixin make-lg-column($columns, $gutter: $grid-gutter-width) {
e8ec7a
  position: relative;
e8ec7a
  // Prevent columns from collapsing when empty
e8ec7a
  min-height: 1px;
e8ec7a
  // Inner gutter via padding
e8ec7a
  padding-left:  ($gutter / 2);
e8ec7a
  padding-right: ($gutter / 2);
e8ec7a
e8ec7a
  // Calculate width based on number of columns available
e8ec7a
  @media (min-width: $screen-lg) {
e8ec7a
    float: left;
e8ec7a
    width: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Generate the large column offsets
e8ec7a
@mixin make-lg-column-offset($columns) {
e8ec7a
  @media (min-width: $screen-lg) {
e8ec7a
    margin-left: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
@mixin make-lg-column-push($columns) {
e8ec7a
  @media (min-width: $screen-lg) {
e8ec7a
    left: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
@mixin make-lg-column-pull($columns) {
e8ec7a
  @media (min-width: $screen-lg) {
e8ec7a
    right: percentage(($columns / $grid-columns));
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
e8ec7a
// Form validation states
e8ec7a
//
e8ec7a
// Used in forms.less to generate the form validation CSS for warnings, errors,
e8ec7a
// and successes.
e8ec7a
e8ec7a
@mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) {
e8ec7a
  // Color the label and help text
e8ec7a
  .help-block,
e8ec7a
  .control-label {
e8ec7a
    color: $text-color;
e8ec7a
  }
e8ec7a
  // Set the border and box shadow on specific inputs to match
e8ec7a
  .form-control {
e8ec7a
    border-color: $border-color;
e8ec7a
    @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
e8ec7a
    &:focus {
e8ec7a
      border-color: darken($border-color, 10%);
e8ec7a
      $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%);
e8ec7a
      @include box-shadow($shadow);
e8ec7a
    }
e8ec7a
  }
e8ec7a
  // Set validation states also for addons
e8ec7a
  .input-group-addon {
e8ec7a
    color: $text-color;
e8ec7a
    border-color: $border-color;
e8ec7a
    background-color: $background-color;
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Form control focus state
e8ec7a
//
e8ec7a
// Generate a customized focus state and for any input with the specified color,
e8ec7a
// which defaults to the `$input-focus-border` variable.
e8ec7a
//
e8ec7a
// We highly encourage you to not customize the default value, but instead use
e8ec7a
// this to tweak colors on an as-needed basis. This aesthetic change is based on
e8ec7a
// WebKit's default styles, but applicable to a wider range of browsers. Its
e8ec7a
// usability and accessibility should be taken into account with any change.
e8ec7a
//
e8ec7a
// Example usage: change the default blue border and shadow to white for better
e8ec7a
// contrast against a dark gray background.
e8ec7a
e8ec7a
@mixin form-control-focus($color: $input-border-focus) {
e8ec7a
  $color-rgba: rgba(red($color), green($color), blue($color), .6);
e8ec7a
  &:focus {
e8ec7a
    border-color: $color;
e8ec7a
    outline: 0;
e8ec7a
    @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba);
e8ec7a
  }
e8ec7a
}
e8ec7a
e8ec7a
// Form control sizing
e8ec7a
//
e8ec7a
// Relative text size, padding, and border-radii changes for form controls. For
e8ec7a
// horizontal sizing, wrap controls in the predefined grid classes. `<select>`
e8ec7a
// element gets special love because it's special, and that's a fact!
e8ec7a
e8ec7a
// [converter] $parent hack
e8ec7a
@mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
e8ec7a
  #{$parent} { height: $input-height;
e8ec7a
  padding: $padding-vertical $padding-horizontal;
e8ec7a
  font-size: $font-size;
e8ec7a
  line-height: $line-height;
e8ec7a
  border-radius: $border-radius; }
e8ec7a
  select#{$parent} {
e8ec7a
    height: $input-height;
e8ec7a
    line-height: $input-height;
e8ec7a
  }
e8ec7a
e8ec7a
  textarea#{$parent} {
e8ec7a
    height: auto;
e8ec7a
  }
e8ec7a
}