$angular-editor-textarea-bg: #fff !default;
$angular-editor-textarea-border-color: #ddd !default;
$angular-editor-textarea-resize-color: rgba(255, 255, 255, 0.5) !default;
$angular-editor-blockquote-border-color: #dfe2e5 !default;
$angular-editor-placeholder-color: #6c757d !default;

$angular-editor-vars: () !default;
$angular-editor-vars: map-merge(
  (
    angular-editor-textarea-bg: $angular-editor-textarea-bg,
    angular-editor-textarea-border-color: $angular-editor-textarea-border-color,
    angular-editor-textarea-resize-color: $angular-editor-textarea-resize-color,
    angular-editor-blockquote-border-color: $angular-editor-blockquote-border-color,
    angular-editor-placeholder-color: $angular-editor-placeholder-color,
  ),
  $angular-editor-vars
);

@mixin angular-editor-theme($overrides) {
  $theme: map-merge($angular-editor-vars, $overrides);

  .angular-editor {
    position: relative;

    ::ng-deep [contenteditable='true']:empty:before {
      content: attr(placeholder);
      // display: block; // for firefox
      color: #868e96;
      opacity: 1;
    }

    .angular-editor-wrapper {
      position: relative;

      .angular-editor-textarea {
        min-height: 5rem;
        margin-top: 0.5rem;
        padding: 0.5rem 0.8rem 1rem 0.8rem;
        border: 1px solid map-get($theme, angular-editor-textarea-border-color);
        background-color: map-get($theme, angular-editor-textarea-bg);
        overflow-x: hidden;
        overflow-y: auto;
        position: relative;
        resize: vertical;

        ::ng-deep blockquote {
          margin-left: 1rem;
          border-left: 0.2em solid map-get($theme, angular-editor-blockquote-border-color);
          padding-left: 0.5rem;
        }

        &:after {
          content: '';
          position: absolute;
          bottom: 0;
          right: 0;
          display: block;
          width: 8px;
          height: 8px;
          cursor: nwse-resize;
          background-color: map-get($theme, angular-editor-textarea-resize-color);
        }
      }

      ::ng-deep p {
        margin-bottom: 0;
      }

      .angular-editor-placeholder {
        display: none;
        position: absolute;
        top: 0;
        padding: 0.5rem 0.8rem 1rem 0.9rem;
        color: map-get($theme, angular-editor-placeholder-color);
        opacity: 0.75;
      }

      &.show-placeholder {
        .angular-editor-placeholder {
          display: block;
        }
      }
      &.disabled {
        cursor: not-allowed;
        opacity: 0.5;
        pointer-events: none;
      }
    }
  }

  .yuz-var {
    background-color: gold;
  }
}
