/***************************
 * Check and Radio buttons *
 ***************************/

 @mixin check($t, $c:$checkradio_bg_color, $tc:$checkradio_fg_color, $checked: false) {
  // Check/Radio drawing function
  //
  // $t:        check/radio type,
  // $c:        base button color for colored* types
  // $tc:       optional text color for colored* types
  // $checked:  bool to chose between checked/unchecked
  //
  // possible $t values:
  // normal, hover, active, insensitive, backdrop, backdrop-insensitive, menu

  $_border_color: $tc;//if($c==$checkradio_bg_color, $checkradio_borders_color, $alt_borders_color);
  $_dim_border_color: transparentize($_border_color, if($variant == 'light', 0.3, 0.7));

  @if $t==normal  {
    background-clip: if($checked, border-box, padding-box);
    background-image: image($c); //linear-gradient(to bottom, lighten($c, 5%) 20%, $c 90%);
    //border-color: $_border_color;
    border-width: $border_width;
    @include relief($_border_color);
    background-color: $c;
    //box-shadow: 0 1px transparentize(black, 0.95);
    color: $tc;
  }

  @if $t==hover {
    background-image: if($c == white, image(darken($c, 5%)), image(lighten($c, 7%)));
  }

  @if $t==active {
    box-shadow: inset 0 1px if($variant == 'light', rgba(0, 0, 0, 0.2), black);
    background-image: if($c == white, image(darken($c, 15%)), image(darken($c, 5%)));
  }

  @if $t==insensitive {
    box-shadow: none;
    color: $insensitive_fg_color;
    background-image: image($insensitive_bg_color);
  }

  @if $t==backdrop {
    background-image: image($c);
    box-shadow: none;
    color: $tc;
  }

  @if $t==backdrop-insensitive {
    box-shadow: none;
    color: $insensitive_fg_color;
    background-image: image($insensitive_bg_color);
  }

  @if $t==menu {
   transform: scale(0.8);
   border-width: 1.2px;
   //border-color: transparent;
   box-shadow: none;
   background-image: image(transparent);
   color: $tc;
  }

  @if $t==menu-active {
   transform: scale(0.8);
   border-width: 1.2px;
   color: $tc;
   box-shadow: none;
   background-image: image(transparent);
  }
 }
