@mixin md-tab-primary {
  > md-tabs-wrapper {
    background-color: '{{primary-color}}';

    md-prev-button md-icon,
    md-next-button md-icon {
      color: '{{primary-contrast}}';
    }
    > md-tabs-canvas {
      > md-pagination-wrapper {
        > md-tab-item:not([disabled]) {
          &, md-icon {
            color: '{{primary-contrast-0.7}}';
          }
          &.md-active, &.md-focused {
            &, md-icon {
              color: '{{primary-contrast}}';
            }
          }
          &.md-focused {
            background: '{{primary-contrast-0.1}}';
          }
        }
        > md-ink-bar {
          color: '{{accent-color}}';
          background: '{{accent-color}}';
        }
      }
    }
  }
  &.md-no-ink-bar-color {
    &>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-ink-bar {
      color: '{{primary-contrast}}';
      background: '{{primary-contrast}}';
    }
  }
}
@mixin md-tab-warn {
  > md-tabs-wrapper {
    background-color: '{{warn-500}}';

    md-prev-button md-icon,
    md-next-button md-icon {
      color: '{{warn-500-contrast}}';
    }
    > md-tabs-canvas {
      > md-pagination-wrapper {
        > md-tab-item:not([disabled]) {
          &, md-icon {
            color: '{{warn-500-contrast-0.7}}';
          }
          &.md-active, &.md-focused {
            &, md-icon {
              color: '{{warn-500-contrast-1}}';
            }
          }
          &.md-focused {
            background: '{{warn-500-contrast-0.1}}';
          }
        }
        > md-ink-bar {
          color: '{{warn-500-contrast}}';
          background: '{{warn-500-contrast}}';
        }
      }
    }
  }
}
@mixin md-tab-accent {
  > md-tabs-wrapper {
    background-color: '{{accent-500}}';

    md-prev-button md-icon,
    md-next-button md-icon {
      color: '{{accent-500-contrast-0.7}}';
    }
    > md-tabs-canvas {
      > md-pagination-wrapper {
        > md-tab-item:not([disabled]) {
          &, md-icon {
            color: '{{accent-500-contrast-0.7}}';
          }
          &.md-active, &.md-focused {
            &, md-icon {
              color: '{{accent-500-contrast-1}}';
            }
          }
          &.md-focused {
            background: '{{accent-500-contrast-0.1}}';
          }
        }
        > md-ink-bar {
          color: '{{accent-500-contrast}}';
          background: '{{accent-500-contrast}}';
        }
      }
    }
  }
}
md-tabs.md-THEME_NAME-theme {
  md-tabs-wrapper {
    background-color: transparent;
    border-color: '{{foreground-4}}';
  }
  md-prev-button md-icon,
  md-next-button md-icon {
    color: '{{foreground-2}}';
  }

  md-ink-bar {
    color: '{{accent-color}}';
    background: '{{accent-color}}';
  }

  .md-tab {
    color: '{{foreground-2}}';
    &[disabled] {
      &, md-icon {
        color: '{{foreground-3}}';
      }
    }
    &.md-active, &.md-focused {
      &, md-icon {
        color: '{{accent-color}}';
      }
    }
    &.md-focused {
      background: '{{primary-color-0.1}}';
    }
    .md-ripple-container {
      color: '{{accent-A100}}';
    }
  }

  &.md-accent {
    @include md-tab-accent();
  }

  &.md-primary {
    @include md-tab-primary();
  }

  &.md-warn {
    @include md-tab-warn();
  }
}

md-toolbar > md-tabs.md-THEME_NAME-theme {
  @include md-tab-primary();
}
md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme {
  @include md-tab-accent();
}
md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme {
  @include md-tab-warn();
}
