/*
 * CloudBeaver - Cloud Database Manager
 * Copyright (C) 2020-2024 DBeaver Corp and others
 *
 * Licensed under the Apache License, Version 2.0.
 * you may not use this file except in compliance with the License.
 */

@import '@material/checkbox/mixins';
$mdc-checkbox-icon-size: 16px;

@mixin checkbox-core-styles($query: mdc-feature-all()) {
  @include mdc-checkbox-core-styles($query);

  .theme-checkbox {
    @extend .mdc-checkbox;
  }
  .theme-checkbox_native-control {
    @extend .mdc-checkbox__native-control;

    &:disabled {
      opacity: 0;
    }
  }
  .theme-checkbox__background {
    @extend .mdc-checkbox__background;
  }
  .theme-checkbox__checkmark {
    @extend .mdc-checkbox__checkmark;
  }
  .theme-checkbox__checkmark-path {
    @extend .mdc-checkbox__checkmark-path;
  }
  .theme-checkbox__mixedmark {
    @extend .mdc-checkbox__mixedmark;
  }
  .theme-checkbox__ripple {
    @extend .mdc-checkbox__ripple;
  }
  .theme-checkbox--checked {
    @extend .mdc-checkbox--selected;
  }
  .theme-checkbox--disabled {
    @extend .mdc-checkbox--disabled;
  }

  .theme-checkbox_primary {
    $mdc-checkbox-mark-color: $mdc-theme-on-primary;
    @include mdc-checkbox-ink-color($mdc-checkbox-mark-color, $query);
    @include mdc-checkbox-disabled-ink-color(rgba($mdc-checkbox-mark-color, 0.5), $query);
    @include mdc-checkbox-container-colors($mdc-checkbox-border-color, transparent, $mdc-theme-primary, $mdc-theme-primary);
  }

  .theme-checkbox_surface {
    $mdc-checkbox-mark-color: $mdc-theme-primary;
    @include mdc-checkbox-ink-color($mdc-checkbox-mark-color, $query);
    @include mdc-checkbox-disabled-ink-color(rgba($mdc-checkbox-mark-color, 0.5), $query);
    @include mdc-checkbox-container-colors($mdc-theme-surface, transparent, $mdc-theme-surface, $mdc-theme-surface);
  }

  .theme-checkbox_on_primary {
    $mdc-checkbox-mark-color: $mdc-theme-primary;
    @include mdc-checkbox-ink-color($mdc-checkbox-mark-color, $query);
    @include mdc-checkbox-disabled-ink-color(rgba($mdc-checkbox-mark-color, 0.5), $query);
    @include mdc-checkbox-container-colors($mdc-theme-on-primary, transparent, $mdc-theme-on-primary, $mdc-theme-on-primary);
  }

  .theme-checkbox_small {
    @include mdc-checkbox-density(-3);
  }
}
