// sundry 杂项

/**
  * 适用于父子元素
  * 父元素 .overlay-l-t
  * 子元素只有一个
  * @example: <div class="overlay-l-t"><h1>test</h1></div>
  */
.overlay-l-t {
  position: relative;
  > * {
    position: absolute;
    left: 0;
    top: 0;
  }
}

.overlay-r-t {
  position: relative;
  > * {
    position: absolute;
    right: 0;
    top: 0;
  }
}

.overlay-l-b {
  position: relative;
  > * {
    position: absolute;
    left: 0;
    bottom: 0;
  }
}

.overlay-r-b {
  position: relative;
  > * {
    position: absolute;
    right: 0;
    bottom: 0;
  }
}

/**
  * 适用于父子元素
  * 父元素 .layout-auto
  * 子元素只有一个, 父元素添加宽高
  * @example: <div class="layout-auto w-full h-200"><span>test</span></div>
  */
.layout-auto {
  position: relative;
  > * {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}

// 文字溢出处理
.overflow-omit {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

@for $line from 1 through 3 {
  .overflow-#{$line} {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: $line;
    overflow: hidden;
  }
}
