All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.scss._core.scss Maven / Gradle / Ivy

Go to download

A beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes, supported fork of sweetalert

The newest version!
@use 'sass:math';

div:where(.swal2-container) {
  display: grid;
  position: fixed;
  z-index: 1060;
  inset: 0;
  box-sizing: border-box;
  grid-template-areas:
    'top-start     top            top-end'
    'center-start  center         center-end'
    'bottom-start  bottom-center  bottom-end';
  grid-template-rows: minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);
  height: 100%; // Safari
  padding: $swal2-container-padding;
  overflow-x: hidden;
  transition: $swal2-backdrop-transition;

  // sweetalert2/issues/905
  -webkit-overflow-scrolling: touch;

  &.swal2-backdrop-show,
  &.swal2-noanimation {
    background: $swal2-backdrop;
  }

  &.swal2-backdrop-hide {
    background: transparent !important;
  }

  &.swal2-top-start,
  &.swal2-center-start,
  &.swal2-bottom-start {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  &.swal2-top,
  &.swal2-center,
  &.swal2-bottom {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  &.swal2-top-end,
  &.swal2-center-end,
  &.swal2-bottom-end {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  &.swal2-top-start > .swal2-popup {
    align-self: start;
  }

  &.swal2-top > .swal2-popup {
    grid-column: 2;
    place-self: start center;
  }

  &.swal2-top-end > .swal2-popup,
  &.swal2-top-right > .swal2-popup {
    grid-column: 3;
    place-self: start end;
  }

  &.swal2-center-start > .swal2-popup,
  &.swal2-center-left > .swal2-popup {
    grid-row: 2;
    align-self: center;
  }

  &.swal2-center > .swal2-popup {
    grid-column: 2;
    grid-row: 2;
    place-self: center center;
  }

  &.swal2-center-end > .swal2-popup,
  &.swal2-center-right > .swal2-popup {
    grid-column: 3;
    grid-row: 2;
    place-self: center end;
  }

  &.swal2-bottom-start > .swal2-popup,
  &.swal2-bottom-left > .swal2-popup {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
  }

  &.swal2-bottom > .swal2-popup {
    grid-column: 2;
    grid-row: 3;
    place-self: end center;
  }

  &.swal2-bottom-end > .swal2-popup,
  &.swal2-bottom-right > .swal2-popup {
    grid-column: 3;
    grid-row: 3;
    place-self: end end;
  }

  &.swal2-grow-row > .swal2-popup,
  &.swal2-grow-fullscreen > .swal2-popup {
    grid-column: 1/4;
    width: 100%;
  }

  &.swal2-grow-column > .swal2-popup,
  &.swal2-grow-fullscreen > .swal2-popup {
    grid-row: 1/4;
    align-self: stretch;
  }

  &.swal2-no-transition {
    transition: none !important;
  }

  div:where(.swal2-popup) {
    display: none;
    position: relative;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 100%);
    width: $swal2-width;
    max-width: 100%;
    padding: $swal2-padding;
    border: $swal2-border;
    border-radius: $swal2-border-radius;
    background: $swal2-background;
    color: $swal2-color;
    font-family: $swal2-font;
    font-size: $swal2-font-size;

    &:focus {
      outline: none;
    }

    &.swal2-loading {
      overflow-y: hidden;
    }
  }

  h2:where(.swal2-title) {
    position: $swal2-title-position;
    max-width: $swal2-title-max-width;
    margin: $swal2-title-margin;
    padding: $swal2-title-padding;
    color: $swal2-title-color;
    font-size: $swal2-title-font-size;
    font-weight: $swal2-title-font-weight;
    text-align: $swal2-title-text-align;
    text-transform: none;
    word-wrap: break-word;
  }

  div:where(.swal2-actions) {
    display: flex;
    z-index: 1; // prevent success icon from overlapping buttons
    box-sizing: border-box;
    flex-wrap: $swal2-actions-flex-wrap;
    align-items: $swal2-actions-align-items;
    justify-content: $swal2-actions-justify-content;
    width: $swal2-actions-width;
    margin: $swal2-actions-margin;
    padding: $swal2-actions-padding;

    &:not(.swal2-loading) {
      .swal2-styled {
        &[disabled] {
          opacity: 0.4;
        }

        &:hover {
          background-image: linear-gradient($swal2-button-darken-hover, $swal2-button-darken-hover);
        }

        &:active {
          background-image: linear-gradient($swal2-button-darken-active, $swal2-button-darken-active);
        }
      }
    }
  }

  div:where(.swal2-loader) {
    display: none;
    align-items: $swal2-loader-align-items;
    justify-content: $swal2-loader-justify-content;
    width: $swal2-loader-width;
    height: $swal2-loader-height;
    margin: $swal2-loader-margin;
    animation: $swal2-loader-animation;
    border-width: $swal2-loader-border-width;
    border-style: $swal2-loader-border-style;
    border-radius: $swal2-loader-border-radius;
    border-color: $swal2-loader-border-color;
  }

  button:where(.swal2-styled) {
    margin: $swal2-button-margin;
    padding: $swal2-button-padding;
    transition: $swal2-button-transition;
    box-shadow: $swal2-button-box-shadow;
    font-weight: $swal2-button-font-weight;

    &:not([disabled]) {
      cursor: pointer;
    }

    &:where(.swal2-confirm) {
      order: $swal2-confirm-button-order;
      border: $swal2-confirm-button-border;
      border-radius: $swal2-confirm-button-border-radius;
      background: initial;
      background-color: $swal2-confirm-button-background-color;
      color: $swal2-confirm-button-color;
      font-size: $swal2-confirm-button-font-size;

      &:focus-visible {
        box-shadow: $swal2-confirm-button-focus-box-shadow;
      }
    }

    &:where(.swal2-deny) {
      order: $swal2-deny-button-order;
      border: $swal2-deny-button-border;
      border-radius: $swal2-deny-button-border-radius;
      background: initial;
      background-color: $swal2-deny-button-background-color;
      color: $swal2-deny-button-color;
      font-size: $swal2-deny-button-font-size;

      &:focus-visible {
        box-shadow: $swal2-deny-button-focus-box-shadow;
      }
    }

    &:where(.swal2-cancel) {
      order: $swal2-cancel-button-order;
      border: $swal2-cancel-button-border;
      border-radius: $swal2-cancel-button-border-radius;
      background: initial;
      background-color: $swal2-cancel-button-background-color;
      color: $swal2-cancel-button-color;
      font-size: $swal2-cancel-button-font-size;

      &:focus-visible {
        box-shadow: $swal2-cancel-button-focus-box-shadow;
      }
    }

    &.swal2-default-outline {
      &:focus-visible {
        box-shadow: $swal2-button-focus-box-shadow;
      }
    }

    &:focus-visible {
      outline: $swal2-button-focus-outline;
    }

    &::-moz-focus-inner {
      border: 0;
    }
  }

  div:where(.swal2-footer) {
    margin: $swal2-footer-margin;
    padding: $swal2-footer-padding;
    border-top: 1px solid $swal2-footer-border-color;
    color: $swal2-footer-color;
    font-size: $swal2-footer-font-size;
    text-align: $swal2-footer-text-align;
  }

  .swal2-timer-progress-bar-container {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    grid-column: auto !important;
    overflow: hidden;
    border-bottom-right-radius: $swal2-border-radius;
    border-bottom-left-radius: $swal2-border-radius;
  }

  div:where(.swal2-timer-progress-bar) {
    width: 100%;
    height: $swal2-timer-progress-bar-height;
    background: $swal2-timer-progress-bar-background;
  }

  img:where(.swal2-image) {
    max-width: 100%;
    margin: $swal2-image-margin;
  }

  button:where(.swal2-close) {
    position: $swal2-close-button-position;
    z-index: 2; // sweetalert2/issues/1617
    align-items: $swal2-close-button-align-items;
    justify-content: $swal2-close-button-justify-content;
    width: $swal2-close-button-width;
    height: $swal2-close-button-height;
    margin-top: $swal2-close-button-gap;
    margin-right: $swal2-close-button-gap;
    margin-bottom: -$swal2-close-button-height;
    padding: $swal2-close-button-padding;
    overflow: hidden;
    transition: $swal2-close-button-transition;
    border: $swal2-close-button-border;
    border-radius: $swal2-close-button-border-radius;
    outline: $swal2-close-button-outline;
    background: $swal2-close-button-background;
    color: $swal2-close-button-color;
    font-family: $swal2-close-button-font-family;
    font-size: $swal2-close-button-font-size;
    cursor: pointer;
    justify-self: $swal2-close-button-justify-self;

    &:hover {
      transform: $swal2-close-button-hover-transform;
      background: $swal2-close-button-hover-background;
      color: $swal2-close-button-hover-color;
    }

    &:focus-visible {
      outline: $swal2-close-button-focus-outline;
      box-shadow: $swal2-close-button-focus-box-shadow;
    }

    &::-moz-focus-inner {
      border: 0;
    }
  }

  .swal2-html-container {
    z-index: 1; // prevent success icon overlapping the content
    justify-content: $swal2-html-container-justify-content;
    margin: $swal2-html-container-margin;
    padding: $swal2-html-container-padding;
    overflow: $swal2-html-container-overflow;
    color: $swal2-html-container-color;
    font-size: $swal2-html-container-font-size;
    font-weight: $swal2-html-container-font-weight;
    line-height: $swal2-html-container-line-height;
    text-align: $swal2-html-container-text-align;
    word-wrap: $swal2-html-container-word-wrap;
    word-break: $swal2-html-container-word-break;
  }

  input:where(.swal2-input),
  input:where(.swal2-file),
  textarea:where(.swal2-textarea),
  select:where(.swal2-select),
  div:where(.swal2-radio),
  label:where(.swal2-checkbox) {
    margin: $swal2-input-margin;
  }

  input:where(.swal2-input),
  input:where(.swal2-file),
  textarea:where(.swal2-textarea) {
    box-sizing: border-box;
    width: $swal2-input-width;
    transition: $swal2-input-transition;
    border: $swal2-input-border;
    border-radius: $swal2-input-border-radius;
    background: $swal2-input-background;
    box-shadow: $swal2-input-box-shadow;
    color: $swal2-input-color;
    font-size: $swal2-input-font-size;

    &.swal2-inputerror {
      border-color: $swal2-error !important;
      box-shadow: 0 0 2px $swal2-error !important;
    }

    &:focus {
      border: $swal2-input-focus-border;
      outline: $swal2-input-focus-outline;
      box-shadow: $swal2-input-focus-box-shadow;
    }

    &::placeholder {
      color: #ccc;
    }
  }

  .swal2-range {
    margin: $swal2-input-margin;
    background: $swal2-background;

    input {
      width: 80%;
    }

    output {
      width: 20%;
      color: $swal2-input-color;
      font-weight: 600;
      text-align: center;
    }

    input,
    output {
      height: $swal2-input-height;
      padding: 0;
      font-size: $swal2-input-font-size;
      line-height: $swal2-input-height;
    }
  }

  .swal2-input {
    height: $swal2-input-height;
    padding: $swal2-input-padding;
  }

  .swal2-file {
    width: 75%;
    margin-right: auto;
    margin-left: auto;
    background: $swal2-input-background;
    font-size: $swal2-input-font-size;
  }

  .swal2-textarea {
    height: $swal2-textarea-height;
    padding: $swal2-textarea-padding;
  }

  .swal2-select {
    min-width: 50%;
    max-width: 100%;
    padding: 0.375em 0.625em;
    background: $swal2-input-background;
    color: $swal2-input-color;
    font-size: $swal2-input-font-size;
  }

  .swal2-radio,
  .swal2-checkbox {
    align-items: center;
    justify-content: center;
    background: $swal2-background;
    color: $swal2-input-color;

    label {
      margin: 0 0.6em;
      font-size: $swal2-input-font-size;
    }

    input {
      flex-shrink: 0;
      margin: 0 0.4em;
    }
  }

  label:where(.swal2-input-label) {
    display: flex;
    justify-content: $swal2-input-label-justify-content;
    margin: $swal2-input-label-margin;
  }

  div:where(.swal2-validation-message) {
    align-items: $swal2-validation-message-align-items;
    justify-content: $swal2-validation-message-justify-content;
    margin: $swal2-validation-message-margin;
    padding: $swal2-validation-message-padding;
    overflow: hidden;
    background: $swal2-validation-message-background;
    color: $swal2-validation-message-color;
    font-size: $swal2-validation-message-font-size;
    font-weight: $swal2-validation-message-font-weight;

    &::before {
      content: '!';
      display: inline-block;
      width: 1.5em;
      min-width: 1.5em;
      height: 1.5em;
      margin: 0 0.625em;
      zoom: $swal2-validation-message-icon-zoom;
      border-radius: 50%;
      background-color: $swal2-validation-message-icon-background;
      color: $swal2-validation-message-icon-color;
      font-weight: 600;
      line-height: 1.5em;
      text-align: center;
    }
  }

  .swal2-progress-steps {
    flex-wrap: $swal2-progress-steps-flex-wrap;
    align-items: $swal2-progress-steps-align-items;
    max-width: $swal2-progress-steps-max-width;
    margin: $swal2-progress-steps-margin;
    padding: $swal2-progress-steps-padding;
    background: $swal2-progress-steps-background;
    font-weight: $swal2-progress-steps-font-weight;

    li {
      display: inline-block;
      position: relative;
    }

    .swal2-progress-step {
      z-index: 20;
      flex-shrink: 0;
      width: $swal2-progress-step-width;
      height: $swal2-progress-step-height;
      border-radius: $swal2-progress-step-border-radius;
      background: $swal2-active-step-background;
      color: $swal2-active-step-color;
      line-height: $swal2-progress-step-height;
      text-align: center;

      &.swal2-active-progress-step {
        background: $swal2-active-step-background;

        ~ .swal2-progress-step {
          background: $swal2-progress-step-background;
          color: $swal2-progress-step-color;
        }

        ~ .swal2-progress-step-line {
          background: $swal2-progress-step-background;
        }
      }
    }

    .swal2-progress-step-line {
      z-index: 10;
      flex-shrink: 0;
      width: $swal2-progress-steps-distance;
      height: 0.4em;
      margin: 0 -1px;
      background: $swal2-active-step-background;
    }
  }
}

@import 'icons';

// github.com/sweetalert2/sweetalert2/issues/268
[class^='swal2'] {
  -webkit-tap-highlight-color: transparent;
}

.swal2-show {
  animation: $swal2-show-animation;
}

.swal2-hide {
  animation: $swal2-hide-animation;
}

.swal2-noanimation {
  transition: none;
}

// Measure scrollbar width for padding body during modal show/hide
.swal2-scrollbar-measure {
  position: absolute;
  top: -9999px;
  width: 50px;
  height: 50px;
  overflow: scroll;
}

// Right-to-left support
.swal2-rtl {
  .swal2-close {
    margin-right: initial;
    margin-left: $swal2-close-button-gap;
  }

  .swal2-timer-progress-bar {
    right: 0;
    left: auto;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy