/**
* c-chip
*/
@import url('../../styles/variables.css');

.c-chip__wrapper {
  display: inline-flex;
  position: relative;
  align-items: center;
  padding: 0 10px;
  height: 28px;
  font-size: 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  color: #fff;
  background-color: var(--gray);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  margin: 0 8px 0 0;

  &:not([disabled]):hover {
    background-color: color(var(--button-default-color) l(var(--button-lightness-hover)));
    color: #fff;
  }

  & .c-icon {
    margin-left: 5px;
  }

  & .c-icon:hover {
    color: #ccc;
  }
}

.c-chip__label {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}

/**
 * type color
 */
@each $color in red, orange, yellow, green, cyan, blue, indigo, purple, pink, gray, dark, black {
  .c-chip--$(color) {
    border-color: var(--$(color));
    background: var(--$(color));
    color: #fff;

    &:not([disabled]):hover {
      background-color: color(var(--$(color)) l(var(--button-lightness-hover)));
      color: #fff;
    }

    &:active,
    &:focus {
      box-shadow: 0 0 0 0.2em color(var(--$(color)) a(0.4));
    }
  }
}

@each $color in dark, black {
  .c-chip--$(color) {
    &:not([disabled]):hover {
      border: 1px solid color(var(--dark) l(var(--button-lightness-hover)));
    }
  }
}

/**
 * chip size
 */

.c-chip__wrapper.is-xs {
  height: 20px;
  padding: 0 6px;

  & .c-chip__label {
    transform: scale(0.9);
  }
}

.c-chip__wrapper.is-sm {
  height: 24px;
  padding: 0 8px;
}

.c-chip__wrapper.is-lg {
  height: 32px;
  padding: 0 12px;

  & .c-chip__label {
    font-size: 14px;
  }
}

.c-chip__wrapper.is-xl {
  height: 36px;
  padding: 0 14px;

  & .c-chip__label {
    font-size: 16px;
  }
}
