/*!
 * @license
 * Copyright Endlessjs. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@import '../../styles/core/mixins';

:host {
  display: inline-block;
  max-width: 100%;

  .select-button {
    @include el-ltr(text-align, left) {
      el-icon {
        right: 0.2em;
      }
    }
    @include el-rtl(text-align, right) {
      el-icon {
        left: 0.2em;
      }
    }
  }

  .select-button.bottom {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .select-button.top {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
}

:host(.full-width) {
  width: 100%;
}

.select-button {
  position: relative;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;

  @include el-component-animation(background-color, border-color, border-radius, box-shadow, color);
}

el-icon {
  font-size: 1.5em;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  @include el-ltr(right, 0.5rem);
  @include el-rtl(left, 0.5rem);
  @include el-component-animation(transform);
}

:host(.open) el-icon {
  transform: translateY(-50%) rotate(180deg);
}
