@import '~@angular/material/theming';
//@import '../../../node_modules/@angular/material/_theming';
@mixin jd-form-theme($theme) {
  $primary: map-get($theme, primary);
  $accent: map-get($theme, accent);
  $warn: map-get($theme, warn);
  $foreground: map-get($theme, foreground);
  $is-dark-theme: map-get($theme, is-dark);
  $background: map-get($theme, background);

  .ant-form-item, .ant-form {
    color: mat-color($foreground, text, 0.65);
  }
  .ant-form-item-required:before {
    color: mat-color($warn);
  }
  .ant-form-item-label label {
    color: mat-color($foreground, text, 0.85);
  }
  .ant-form-explain,
  .ant-form-extra {
    color: mat-color($foreground, text, 0.45);
  }
  .ant-form {
    legend {
      color: mat-color($foreground, text, 0.45);
    }
    output {
      color: mat-color($foreground, text, 0.65);
    }
  }
  .has-error {
    &.has-feedback {
      .ant-form-item-children:after {
        color: mat-color($warn);
      }
    }
    .ant-form-explain, .ant-form-split, .ant-input-prefix, .ant-input-group-addon,
    .has-feedback, .ant-select-selection, .ant-calendar-picker-icon:after, .ant-time-picker-icon:after,
    .ant-picker-icon:after, .ant-select-arrow, .ant-cascader-picker-arrow{
      color: mat-color($warn);
    }
    .ant-input-group-addon {
      background-color: mat-color($background, card);
    }
    .ant-input, .ant-input:hover, .ant-input:not([disabled]):hover, .ant-input-group-addon,
    .ant-select.ant-select-auto-complete .ant-input:focus, .ant-input-number, .ant-time-picker-input,
    .ant-input-number:not([disabled]):hover, .ant-time-picker-input:not([disabled]):hover,
    .ant-mention-wrapper .ant-mention-editor, .ant-mention-wrapper .ant-mention-editor:not([disabled]):hover{
      border-color: mat-color($warn);
    }

    .ant-input:focus, .ant-calendar-picker-open .ant-calendar-picker-input,
    .ant-select-open .ant-select-selection,
    .ant-select-focused .ant-select-selection,
    .ant-input-number-focused,
    .ant-time-picker-input-focused,
    .ant-input-number:focus,
    .ant-time-picker-input:focus,
    .ant-mention-wrapper.ant-mention-active:not([disabled]) .ant-mention-editor,
    .ant-mention-wrapper .ant-mention-editor:not([disabled]):focus,
    .ant-cascader-picker:focus .ant-cascader-input {
      $hue: hue(mat-color($warn));
      $sa: saturation(mat-color($warn));
      border-color: lighten(mat-color($warn), 8%);
      box-shadow: 0 0 0 2px  rgba(lighten(mat-color($warn), 8%), 0.5);
    }
  }
}


