@use "sass:color";
@use "mixins";

%text-overflow {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -o-text-overflow: ellipsis;
  -ms-text-overflow: ellipsis;
  -moz-text-overflow: ellipsis;
}

%field-with-error {
  border-color: var(--notice-error-border-color);
  color: var(--notice-error-text-color);
  background-color: var(--form-field-error-bg-color);
  box-shadow: var(--form-field-error-box-shadow);
}

%default-input-style {
  border-radius: var(--border-radius_medium);
  box-shadow: var(--form-field-box-shadow);
  font: var(--font-default);
  color: var(--form-field-text-color);
  padding: var(--form-field-padding);
  margin: var(--form-field-margin);
  background: var(--form-field-background-color);
  border-width: var(--form-field-border-width);
  border-style: var(--form-field-border-style);
  border-color: var(--form-field-border-color);
  height: var(--form-field-height);
  width: 100%;
  font-size: var(--form-field-font-size);
  line-height: var(--form-field-line-height);
  transition: var(--transition-duration);

  &:focus:not(.readonly) {
    @include mixins.default-focus-style(
      $box-shadow: 0 0 0 1px var(--focus-color)
    );
  }

  &[disabled],
  &.disabled,
  &:not(.flatpickr-input)[readonly],
  &:not(.flatpickr-input).readonly {
    color: var(--form-field-disabled-text-color);
    background-color: var(--form-field-disabled-bg-color);
    cursor: default;
  }

  &[disabled],
  &.disabled {
    cursor: not-allowed;
  }

  &:not(.flatpickr-input)[readonly],
  &:not(.flatpickr-input).readonly {
    pointer-events: none;
  }
}

%gradiated-toolbar {
  display: flex;
  background: var(--toolbar-bg-color);
  padding: var(--toolbar-padding);
  height: var(--toolbar-height);
  border-bottom: var(--toolbar-border-bottom);
}
