@import "./../variable.scss";

$height-md: $height-normal;
$height-bg: 60px;

// 下拉选择组件的样式
.hx-dropdown {
  display: inline-block;
  height: $height-md;
  min-width: 100px;
  position: relative;
  .button {
    height: 100%;
    width: 100%;
  }
  &:hover {
    .pad-options {
      display: block;
      opacity: 1.0;
      top: $height-md + $pm-md;
    }
  }
  .pad-options {
    position: absolute;
    padding-top: $pm-md;
    top: $height-md;
    @include centerHorizontal;
    background-color: transparent;
    transition: top .5s, opacity .5s;
    opacity: .0;
  }
  .list {
    z-index: 100;
    display: block;
    list-style: none;
    border: 1px solid $color-gray;
    padding: $pm-sm;
    margin: 0;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 0 30px rgba(0,0,0,.15);
    &::before {
      height: 0;
      width: 0;
      content: "";
      position: absolute;
      margin-top: 0;
      top: $pm-md - 5px;
      border-bottom: 7px solid white;
      border-top: none;
      border-left: 7px solid transparent;
      border-right: 7px solid transparent;
      @include centerHorizontal;
    }
    .item {
      min-width: 100px;
      display: block;
      text-align: center;
      padding: 0 $pm-sm;
      font-size: 14px;
      height: $height-regular;
      white-space: nowrap;
      line-height: $height-regular + 2px;
      border-radius: $border-radius-md;
      cursor: default;
      &:hover {
        background-color: $color-gray-light;
      }
      &:active {
        background-color: $color-gray;
      }
    }
  }
  &.bg {
    height: $height-bg;
    &:hover{
      .list {
          display: block;
          opacity: 1.0;
          top: $height-bg + $pm-md;
      }
    }
  }
}