Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

2.3 KB
Raw Blame
@use '../../../styles/mixins' as *;

.root {
  position: relative;
  display: flex;
  bottom: 0;
  width: 100%;
  padding: 0.6em;
  background-color: var(--theme-color-components-chat-background);

  .inputWrap {
    position: relative;
    display: flex;
    color: var(--theme-color-components-form-field-text);
    background-color: var(--theme-color-palette-3);
    border-radius: var(--theme-rounded-corners);
    bottom: 0;
    width: 100%;
    padding: 0.3rem;
    transition: box-shadow 90ms ease-in-out;

    &:focus-within {
      background-color: var(--theme-color-components-form-field-background);
      box-shadow: inset 0 0 2px 2px var(--theme-color-palette-3);
    }

    // Size of custom emoji.
    img {
      width: 20px;
      height: 20px;
    }
  }

  .maxCharacters {
    border-style: solid;
    border-width: 2px;
    border-color: red;
  }

  div[role='textbox'] {
    font-size: 13px;
    font-weight: 400;
    padding: 0.3rem;
    background-color: inherit;
    border-color: var(--theme-color-components-form-field-border);
    box-shadow: 0;
    transition: box-shadow 50ms ease-in-out;
    max-height: 40px; // 2 lines of text
    min-height: 30px;
    cursor: text;
    overflow-x: auto;

    &:focus {
      outline: 1px solid var(--color-owncast-gray-500) !important;
    }

    & > p {
      margin: 0;
    }
  }

  // Placeholder styling
  :empty::before {
    content: attr(placeholder);
    display: block;
    color: #aaa;
  }
}

.emojiButton {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0 0.25rem;
}

.sendButton {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0 1rem;
}

// emoji-mart's shadow root sets `:host { width: min-content }` and its preview
// label is nowrap, so without an explicit width the picker resizes every time you
// hover a different emoji. Both rules below are needed: an outer-document rule is
// what overrides `:host`. The popover is anchored `topRight` to the emoji button,
// so the usable width is the viewport minus the gutter to the right of that
// button (send button plus the input's padding) — anything wider is clipped off
// the left edge on phones, since antd only flips `topRight` on overflow, it never
// shifts it.
.emojiPickerContainer {
  width: min(350px, calc(100vw - 5rem));
  max-height: 70vh;
  overflow: auto hidden;

  em-emoji-picker {
    width: 100%;
  }
}