$theme-colors: (
  'primary': $primary,
  'blue': $blue,
  'green': $green,
  'red': $red,
  'yellow': $yellow,
  'gray': $grey
);

@mixin color-modifier($properties...) {
  @each $name, $value in $theme-colors {
    &--#{$name} {
      @each $property in $properties {
        #{$property}: #{$value};
      }
    }
  }
}

@mixin color-modifier-progress($property, $opacity, $inner-elem, $inner-elem-property) {
  @each $name, $value in $theme-colors {
    &--#{$name} {
      #{$property}: #{$value};
      background: rgba($value, $opacity);

      .#{$inner-elem} {
        #{$inner-elem-property}: #{$value};
      }
    }
  }
}

.text-red   { color: $red; }
.text-green { color: $green; }
.text-muted { color: rgba($secondary, .6);  }

.middot {
  @include rem(margin, 0 10px)
}

.text {
  @include color-modifier(color)
}

.automargin {float: none;margin-right: auto; margin-left: auto;}
.bold {font-weight: $fw-semi}
.semibold {font-weight: $fw-semi}

.t-simulate { display: table; width: 100%; height: 100%;}
.t-row {display: table-row; width: 100%; height: 100%}
.t-cell {display: table-cell; vertical-align: middle}

.nopadding {padding: 0}

%noselect {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;
}

%disable-list-style {
  list-style: none;
  padding: 0;
  margin: 0;

  li {
    &:after, &:before {
      content: '';
      display: none;
    }
  }
}

.fs22 {
  @include rem(font-size, 22px);
}

.grayscale {
  filter: gray; /* IE6-9 */
  -webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}

.relative {
  position: relative;
}

.mb0 {
  margin-bottom: 0 !important;
}