@import "./chip-button.vars";

// Chip Button
// --------------------------------------------------

:host {
  /**
   * @prop --background: Background of the Chip Button
   * @prop --color: Color of the Chip Button
   * @prop --border-radius: Border radius of the Chip Button
   * @prop --margin-top: Margin top of the Chip Button
   * @prop --margin-end: Margin end of the Chip Button
   * @prop --margin-bottom: Margin bottom of the Chip Button
   * @prop --margin-start: Margin start of the Chip Button
   * @prop --width: Width of the Chip Button
   * @prop --height: Height of the Chip Button
   */
  --border-radius: #{$chip-button-border-radius};
  --margin-top: #{$chip-button-margin-top};
  --margin-end: #{$chip-button-margin-end};
  --margin-bottom: #{$chip-button-margin-bottom};
  --margin-start: #{$chip-button-margin-start};
  --width: #{$chip-button-width};
  --height: #{$chip-button-height};

  width: var(--width);
  height: var(--height);

  font-size: #{$chip-button-font-size};
}

:host(.chip-button-clear) {
  --background: transparent;
  --color: #{$chip-button-clear-color};
}

:host(.chip-button-solid) {
  --background: #{ion-color(primary, base)};
  --color: #{ion-color(primary, contrast)};
}

:host(.chip-button-solid.ion-color) .chip-button-native {
  background: current-color(base);
  color: current-color(contrast);
}

:host(.chip-button-clear.ion-color) .chip-button-native {
  background: transparent;
  color: current-color(base);
}

.chip-button-native {
  @include text-inherit();
  @include border-radius(var(--border-radius));
  @include margin(var(--margin-top), var(--margin-end), var(--margin-bottom), var(--margin-start));

  position: relative;

  width: var(--width);
  height: var(--height);

  border: 0;

  outline: none;

  background: var(--background);
  color: var(--color);
  appearance: none;
}

.chip-button-inner {
  display: flex;

  flex-flow: row nowrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;
}
