@import "../../themes/ionic.globals";

// Content
// --------------------------------------------------

:host {
  /**
   * @prop --background: Background of the Content
   * @prop --color: Color of the Content
   * @prop --padding-top: Padding top of the Content
   * @prop --padding-bottom: Padding bottom of the Content
   * @prop --padding-start: Padding start of the Content
   * @prop --padding-end: Padding end of the Content
   * @prop --keyboard-offset: Keyboard offset of the Content
   * @prop --offset-top: Offset top of the Content
   * @prop --offset-bottom: Offset bottom of the Content
   */
  --background: #{$background-color};
  --color: #{$text-color};
  --padding-top: 0px;
  --padding-bottom: 0px;
  --padding-start: 0px;
  --padding-end: 0px;
  --keyboard-offset: 0px;
  --offset-top: 0px;
  --offset-bottom: 0px;

  display: block;
  position: relative;

  flex: 1;

  /* stylelint-disable */
  padding: 0 !important;
  margin: 0 !important;
  /* stylelint-enable */

  background: var(--background);
  color: var(--color);

  font-family: $font-family-base;

  contain: layout size style;
}

:host(.ion-color) {
  background: current-color(base);
  color: current-color(contrast);
}

// TODO we should remove outer-content in favor of a color
:host(.outer-content) {
  --background: #{$background-color-step-50};
}

.inner-scroll {
  @include position(calc(var(--offset-top) * -1), 0,calc(var(--offset-bottom) * -1), 0);
  @include padding(calc(var(--padding-top) + var(--offset-top)), var(--padding-end), calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom)), var(--padding-start));

  position: absolute;

  box-sizing: border-box;

  overflow: hidden;
}

.scroll-y,
.scroll-x {
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
  overscroll-behavior: contain;
}

.scroll-y {
  overflow-y: auto;
}

.scroll-x {
  overflow-x: auto;
}

.overscroll::before,
.overscroll::after {
  position: absolute;

  width: 1px;
  height: 1px;

  content: "";
}

.overscroll::before {
  bottom: -1px;
}

.overscroll::after {
  top: -1px;
}
