//
// Copyright 2017 Google Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions://
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

@import "@material/theme/mixins";
@import "@material/list/mixins";
@import "@material/ripple/mixins";
@import "./variables";

@mixin mdc-drawer-activated-overlay-color($color) {
  :not(.mdc-list--non-interactive) > .mdc-list-item {
    @include mdc-states-activated($color);
  }
}

@mixin mdc-drawer-border-color($color) {
  $value: rgba(mdc-theme-prop-value($color), $mdc-drawer-divider-opacity);

  @include mdc-theme-prop(border-color, $value);
}

@mixin mdc-drawer-item-corner-radius($radius) {
  @include mdc-list-item-corner-radius($radius);
}

@mixin mdc-drawer-divider-color($color) {
  $value: rgba(mdc-theme-prop-value($color), $mdc-drawer-divider-opacity);

  @include mdc-list-divider-color($value);
}

@mixin mdc-drawer-title-ink-color($color) {
  $value: rgba(mdc-theme-prop-value($color), $mdc-drawer-title-ink-opacity);

  .mdc-drawer__title {
    @include mdc-theme-prop(color, $value);
  }
}

@mixin mdc-drawer-subtitle-ink-color($color) {
  $value: rgba(mdc-theme-prop-value($color), $mdc-drawer-subtitle-ink-opacity);

  @include mdc-list-group-subheader-ink-color($value);

  .mdc-drawer__subtitle {
    @include mdc-theme-prop(color, $value);
  }
}

@mixin mdc-drawer-fill-color-accessible($color) {
  $accessibleColor: mdc-theme-accessible-ink-color($color);

  @include mdc-drawer-title-ink-color($accessibleColor);
  @include mdc-drawer-subtitle-ink-color($accessibleColor);
  @include mdc-drawer-item-text-ink-color($accessibleColor);
  @include mdc-drawer-item-icon-ink-color($accessibleColor);
  @include mdc-drawer-surface-fill-color($color);
}

@mixin mdc-drawer-item-icon-ink-color($color) {
  $value: rgba(mdc-theme-prop-value($color), $mdc-drawer-item-inactive-icon-ink-opacity);

  @include mdc-list-item-graphic-ink-color($value);
}

@mixin mdc-drawer-item-activated-icon-ink-color($color) {
  $value: rgba(mdc-theme-prop-value($color), $mdc-drawer-item-active-icon-ink-opacity);

  .mdc-list-item--activated {
    @include mdc-list-item-graphic-ink-color($value);
  }
}

@mixin mdc-drawer-item-activated-text-ink-color($color) {
  $value: rgba(mdc-theme-prop-value($color), $mdc-drawer-item-active-text-ink-opacity);

  .mdc-list-item--activated {
    @include mdc-list-item-primary-text-ink-color($value);
  }
}

@mixin mdc-drawer-item-text-ink-color($color) {
  $value: rgba(mdc-theme-prop-value($color), $mdc-drawer-item-inactive-text-ink-opacity);

  .mdc-list-item {
    @include mdc-list-item-primary-text-ink-color($value);
  }
}

@mixin mdc-drawer-surface-fill-color($color) {
  $value: mdc-theme-prop-value($color);

  @include mdc-theme-prop(background-color, $value);
}

@mixin mdc-drawer-scrim-fill-color($color) {
  $value: rgba(mdc-theme-prop-value($color), $mdc-drawer-modal-scrim-opacity);

  + .mdc-drawer-scrim {
    @include mdc-theme-prop(background-color, $value);
  }
}
