/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../custom.less';
@import './vars.less';

@tag-prefix-cls: ~'@{css-prefix}tag';
@tag-group-prefix-cls: ~'@{css-prefix}tag-group';

.@{tag-group-prefix-cls} {
  .inject-TagGroup-vars();

  overflow: hidden;
  position: relative;
  margin-bottom: var(--tv-TagGroup-margin-bottom);

  .@{tag-prefix-cls} {
    margin-right: var(--tv-TagGroup-item-margin-right);
    margin-bottom: var(--tv-TagGroup-item-margin-bottom);

    &:last-child {
      margin-right: 0;
    }
  }

  &.@{tag-group-prefix-cls}-has-more {
    padding-right: var(--tv-TagGroup-more-icon-safe-space);
    .@{tag-group-prefix-cls}_icon {
      position: absolute;
      right: 0;
      top: 0;

      svg {
        height: 21px; // 纯图标tag高度不够
      }
    }
  }
}

// popover弹出层里面的 tag 子项也要有边距
.@{tag-group-prefix-cls}-popper {
  .inject-TagGroup-vars();

  .@{tag-prefix-cls} {
    margin-right: var(--tv-TagGroup-item-margin-right);
    margin-bottom: var(--tv-TagGroup-item-margin-bottom);

    &:last-child {
      margin-right: 0;
    }
  }
}
