// Copyright 2016 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/rtl/mixins";
@import "@material/theme/mixins";
@import "./variables";

//
// Public
//

@mixin mdc-list-item-primary-text-ink-color($color) {
  @include mdc-theme-prop(color, $color);
}

@mixin mdc-list-item-secondary-text-ink-color($color) {
  .mdc-list-item__secondary-text {
    @include mdc-theme-prop(color, $color);
  }
}

@mixin mdc-list-item-graphic-fill-color($color) {
  .mdc-list-item__graphic {
    @include mdc-theme-prop(background-color, $color);
  }
}

@mixin mdc-list-item-graphic-ink-color($color) {
  .mdc-list-item__graphic {
    @include mdc-theme-prop(color, $color);
  }
}

@mixin mdc-list-item-meta-ink-color($color) {
  .mdc-list-item__meta {
    @include mdc-theme-prop(color, $color);
  }
}

@mixin mdc-list-item-corner-radius($radius) {
  .mdc-list-item {
    border-radius: $radius;
  }
}

@mixin mdc-list-divider-color($color) {
  .mdc-list-divider {
    @include mdc-theme-prop(border-bottom-color, $color);
  }
}

@mixin mdc-list-group-subheader-ink-color($color) {
  .mdc-list-group__subheader {
    @include mdc-theme-prop(color, $color);
  }
}

//
// Private
//

// Sets the width and height of the graphic element, as well as calculates the margins for
// the graphic element such that the text is always offset by 72px, which is defined within
// the spec.
@mixin mdc-list-graphic-size_($size) {
  $text-offset: 72px;
  $side-padding: $mdc-list-side-padding;
  $margin-value: $text-offset - $side-padding - $size;

  @include mdc-rtl-reflexive-box(margin, right, $margin-value, ".mdc-list-item");

  width: $size;
  height: $size;
}
