@import "../../themes/mixins";

// Toolbar
// --------------------------------------------------

:host {
  /**
   * @prop --background: Background of the toolbar
   *
   * @prop --border-color: Color of the toolbar border
   * @prop --border-style: Style of the toolbar border
   * @prop --border-width: Width of the toolbar border
   *
   * @prop --color: Color of the toolbar text
   *
   * @prop --min-height: Minimum height of the toolbar
   *
   * @prop --opacity: Opacity of the toolbar background
   *
   * @prop --padding-top: Top padding of the toolbar
   * @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the toolbar
   * @prop --padding-bottom: Bottom padding of the toolbar
   * @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the toolbar
   */
  --border-width: 0;
  --border-style: solid;
  --opacity: 1;
  --opacity-scale: 1;

  @include font-smoothing();

  display: block;

  position: relative;

  width: 100%;

  // stylelint-disable-next-line property-disallowed-list
  padding-right: var(--ion-safe-area-right);
  // stylelint-disable-next-line property-disallowed-list
  padding-left: var(--ion-safe-area-left);

  color: var(--color);

  contain: content;

  box-sizing: border-box;
}

.toolbar-container {
  @include padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));

  display: flex;

  position: relative;

  flex-direction: row;
  align-items: center;
  justify-content: space-between;

  width: 100%;

  min-height: var(--min-height);

  contain: content;
  overflow: hidden;

  box-sizing: border-box;
}

// Toolbar: Transparent
// --------------------------------------------------

.toolbar-background {
  @include position(0, 0, 0, 0);

  position: absolute;

  transform: translateZ(0);

  border-width: var(--border-width);
  border-style: var(--border-style);
  border-color: var(--border-color);

  background: var(--background);

  contain: strict;
  opacity: calc(var(--opacity) * var(--opacity-scale));
  pointer-events: none;
}

// Toolbar: Progress Bar
// --------------------------------------------------

::slotted(ion-progress-bar) {
  @include position(null, 0, 0, 0);

  position: absolute;
}
