// added the ext part for when we need selected (or dark) assets
@mixin check($ext : "") {
  -gtk-icon-source: gtkscale("assets/checkbox-unchecked" + $ext, ".png");
  &:backdrop { -gtk-icon-source: gtkscale("assets/checkbox-unchecked-unfocused" + $ext, ".png"); }
  &:disabled { -gtk-icon-source: gtkscale("assets/checkbox-unchecked-insensitive" + $ext, ".png");
    &:backdrop { -gtk-icon-source: gtkscale("assets/checkbox-unchecked-insensitive-unfocused" + $ext, ".png"); }
  }
  &:active, &:checked { -gtk-icon-source: gtkscale("assets/checkbox-checked" + $ext, ".png");
    &:backdrop { -gtk-icon-source: gtkscale("assets/checkbox-checked-unfocused" + $ext, ".png"); }
    &:disabled { -gtk-icon-source: gtkscale("assets/checkbox-checked-insensitive" + $ext, ".png");
      &:backdrop { -gtk-icon-source: gtkscale("assets/checkbox-checked-insensitive-unfocused" + $ext, ".png"); }
    }
  }
  &:indeterminate { -gtk-icon-source: gtkscale("assets/checkbox-mixed" + $ext, ".png");      
    &:backdrop { -gtk-icon-source: gtkscale("assets/checkbox-mixed-unfocused" + $ext, ".png"); }
    &:disabled { -gtk-icon-source: gtkscale("assets/checkbox-mixed-insensitive" + $ext, ".png");        
      &:backdrop { -gtk-icon-source: gtkscale("assets/checkbox-mixed-insensitive-unfocused" + $ext, ".png"); }
    }
  }
}

@mixin radio($ext : "") {
  -gtk-icon-source: gtkscale("assets/radio-unchecked" + $ext, ".png");
  &:backdrop { -gtk-icon-source: gtkscale("assets/radio-unchecked-unfocused" + $ext, ".png"); }
  &:disabled { -gtk-icon-source: gtkscale("assets/radio-unchecked-insensitive" + $ext, ".png");
    &:backdrop { -gtk-icon-source: gtkscale("assets/radio-unchecked-insensitive-unfocused" + $ext, ".png"); }
  }
  &:active, &:checked { -gtk-icon-source: gtkscale("assets/radio-checked" + $ext, ".png");
    &:backdrop { -gtk-icon-source: gtkscale("assets/radio-checked-unfocused" + $ext, ".png"); }
    &:disabled { -gtk-icon-source: gtkscale("assets/radio-checked-insensitive" + $ext, ".png");
      &:backdrop { -gtk-icon-source: gtkscale("assets/radio-checked-insensitive-unfocused" + $ext, ".png"); }
    }
  }
  &:indeterminate { -gtk-icon-source: gtkscale("assets/radio-mixed" + $ext, ".png");
    &:backdrop { -gtk-icon-source: gtkscale("assets/radio-mixed-unfocused" + $ext, ".png"); }
    &:disabled { -gtk-icon-source: gtkscale("assets/radio-mixed-insensitive" + $ext, ".png");
      &:backdrop { -gtk-icon-source: gtkscale("assets/radio-mixed-insensitive-unfocused" + $ext, ".png"); }
    }
  }
}

@mixin checkradio() {
  checkbutton.text-button, radiobutton.text-button {
    padding: 4px;
    outline-offset: 0;
  }

  check, radio {
    margin: 4px;
    min-height: $check_size;
    min-width: $check_size;    
  }
  
  check, .check { @include check();
    row:selected & { @include check("-selected"); }
  }
  
  radio, .radio { @include radio();
    row:selected & { @include radio("-selected"); }
  }
  
  menuitem, .menuitem, menuitem.button.flat, .menuitem.button.flat, modelbutton.flat, menuitem.button.flat {
    check { @include check();
      &:hover { @include check("-selected"); }
    }
    radio { @include radio();
      &:hover { @include radio("-selected"); }
    }
  }
}
