.c-attachments-card

scss
.c-attachments-card {
  border-radius: 4px;
  box-shadow: $box-shadow-card-lvl-2;
  height: 0;
  overflow: hidden;
  position: relative;
  visibility: hidden;
  width: auto;

  @include modifier('visible') {
    height: fit-content;
    visibility: visible;
  }

  @include element('header') {
    @include use-font('subheading', 'light');
    align-items: center;
    background-color: use-color('complementary', 'light');
    color: use-color('base', 'white');
    display: flex;
    padding: 8px;
  }

  @include element('label') {
    align-items: center;
    display: flex;
    text-decoration: underline;
  }

  @include element('close-icon') {
    color: use-color('base', 'white');
    margin-right: 8px;
    
    [class^='icon-'],
    [class*=' icon-'] {
      display: flex;
    }
  }

  @include element('content') {
    display: flex;
    margin: 0 8px;
    overflow-x: scroll;
    padding: 8px 0;
    position: relative;

    @include media-breakpoint-up('tablet') {
      margin: 0 16px;
      padding: 16px 0;
    }

    // overrides
    .c-attachment-item {
      margin-right: 8px;

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

Card creada para contener los items adjuntos.

Elementos

  • .c-attachments-card__header: Header para elementos adjuntos.
    • .c-attachments-card__close-icon: Icono cerrar.
    • .c-attachments-card__label: estilos para el label del header.
  • .c-attachments-card__content: contenedor de items adjuntos.

Modificador

  • .c-attachments-card--visible: hace la card visible para el usuario.

Example

html
<div class="u-example-padding">

<div class="c-attachments-card c-attachments-card--visible">
  <div class="c-attachments-card__header">
    <a class="c-attachments-card__close-icon">
      <span class="icon-close"></span>
    </a>

    <label class="c-attachments-card__label">
      Adjunto(s)
    </label>
  </div>

  <div class="c-attachments-card__content">
    <div class="c-attachment-item">
      <div class="c-attachment-item__close">
        <span class="icon-close"></span>
      </div>
      <img class="c-attachment-item__image" src="https://cdn.chattigo.com/assets/img/attachment/preview/PDF.svg" />
    </div>

    <div class="c-attachment-item">
      <div class="c-attachment-item__close">
        <span class="icon-close"></span>
      </div>
      <img class="c-attachment-item__image" src="https://cdn.chattigo.com/assets/img/attachment/preview/DOCX.svg" />
    </div>

    <div class="c-attachment-item">
      <div class="c-attachment-item__close">
        <span class="icon-close"></span>
      </div>
      <img class="c-attachment-item__image" src="https://cdn.chattigo.com/assets/img/attachment/preview/Audio.svg" />
    </div>
  </div>
</div>

</div>

.c-attachment-item

scss
.c-attachment-item {
  height: 80px;
  position: relative;
  width: 80px;

  @include element('close') {
    align-items: center;
    background-color: use-color('base', 'black');
    border: solid 1px use-color('base', 'true-white');
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    height: 20px;
    justify-content: center;
    position: absolute;
    right: -4px;
    top: -4px;
    width: 20px;
    
    [class^='icon-'],
    [class*=' icon-'] {
      color: use-color('base', 'true-white');
      font-size: 8px;
    }
  }

  @include element('image') {
    border-radius: 8px;
    display: inline-block;
    height: 80px;
  }
}

Item para elementos adjuntos.

Elementos

  • .c-attachment-item__close: elemento de cierre.
  • .c-attachment-item__image: imagen de preview.

Example

html
<div class="u-example-padding">

<div class="c-attachment-item">
  <div class="c-attachment-item__close">
    <span class="icon-close"></span>
  </div>
  <img class="c-attachment-item__image" src="https://cdn.chattigo.com/assets/img/attachment/preview/DOCX.svg" />
</div>

</div>