@import "../common/varible";
@import "../common/function";

// 预览作为upload的子组件
ul.yu-file-list {
  font-family: $font-family;
  font-size: $normal;
  color: $text;
  @include reset-ul();
  &>li{
    font-size: 0;
    &>span{
      vertical-align: middle;
      font-size: $normal;
    }
    &>i{
      vertical-align: middle;
      font-size: $normal;
    }
  }
  &.simple {
    & > li {
      @include generalAllColorFileList();
      transition: background-color $transition-time ease;
      &:hover {
        background-color: $background;
        & > i.icon-close {
          opacity: 1;
          &:hover {
            color: darken($text-light, 10);
          }
        }
      }
      padding: $space-tiny;
      & > i {
        font-size: $normal;
        &.icon-close {
          cursor: pointer;
          color: $text-light;
          transition: opacity $transition-time ease;
          float: right;
          opacity: 0;
          padding: $space-tiny;
        }
      }
    }
  }

  &.picture {
    & > li {
      width: $file-list-picture-length;
      height: $file-list-picture-length;
      box-sizing: border-box;
      border: 1px solid $border;
      border-radius: $radius;
      display: inline-block;
      margin: 0 $space-small $space 0;
      $height: $file-list-picture-length - 2;
      & > .wrap {
        font-size: 0;
        position: relative;
        height: 100%;
        line-height: $height;
        text-align: center;
        & > img {
          vertical-align: middle;
          max-width: $height;
          max-height: $height;
        }
        & > .mask {
          position: absolute;
          opacity: 0;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background-color: $dialog-background;
          color: #fff;
          text-align: center;
          transition: opacity $transition-time ease;
          & > i {
            opacity: 0.8;
            margin: 0 $space-tiny;
            cursor: pointer;
            transition: opacity $transition-time ease;
            &:hover {
              opacity: 1;
            }
          }
        }
        &:hover {
          & > .mask {
            opacity: 1;
          }
        }
      }
    }
  }

  &.title-picture {
    & > li {
      position: relative;
      height: $file-list-title-picture-length;
      box-sizing: border-box;
      border: 1px solid $border;
      border-radius: $radius;
      margin: 0 $space-small $space 0;
      display: flex;
      $height: $file-list-title-picture-length - 2;
      & > .wrap {
        font-size: 0;
        width: $height;
        height: $height;
        line-height: $height;
        text-align: center;
        display: inline-block;
        align-items: center;
        & > img {
          vertical-align: middle;
          max-width: $height;
          max-height: $height;
        }
      }
      &>span{
        align-items: center;
        vertical-align: middle;
        line-height: $height;
        word-break: break-all;
        padding: 0 $space-small;
        white-space: nowrap;
        overflow: hidden;
        text-overflow : ellipsis;
      }
      i.icon-close{
        position: absolute;
        top: 0;
        right: 0;
      }
      &:hover {
        & > i.icon-close {
          opacity: 1;
          &:hover {
            color: darken($text-light, 10);
          }
        }
      }
      & > i {
        font-size: $normal;
        vertical-align: middle;
        &.icon-close {
          cursor: pointer;
          color: $text-light;
          transition: opacity $transition-time ease;
          float: right;
          opacity: 0;
          padding: $space-tiny;
        }
      }
    }
  }

  &.inline{
    display: flex;
    & > li {
      width: $file-list-title-picture-inline-width;
    }
  }
  &.block{
    & > li {
      width: 100%;
    }
  }
}

