sweetalert.css 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. @import './css/icons';
  2. @import './css/text';
  3. @import './css/buttons';
  4. @import './css/content';
  5. @import './css/button-loader';
  6. :root {
  7. --swal-modal-width: 478px;
  8. }
  9. .swal-overlay {
  10. position: fixed;
  11. top: 0;
  12. bottom: 0;
  13. left: 0;
  14. right: 0;
  15. text-align: center;
  16. font-size: 0; /* Remove gap between inline-block elements */
  17. overflow-y: auto;
  18. background-color: rgba(0, 0, 0, 0.4);
  19. z-index: 10000;
  20. pointer-events: none;
  21. opacity: 0;
  22. transition: opacity 0.3s;
  23. &::before {
  24. content: ' ';
  25. display: inline-block;
  26. vertical-align: middle; /* vertical alignment of the inline element */
  27. height: 100%;
  28. }
  29. &--show-modal {
  30. opacity: 1;
  31. pointer-events: auto;
  32. & .swal-modal {
  33. opacity: 1;
  34. pointer-events: auto;
  35. box-sizing: border-box;
  36. animation: showSweetAlert 0.3s;
  37. will-change: transform;
  38. }
  39. }
  40. }
  41. .swal-modal {
  42. width: var(--swal-modal-width);
  43. opacity: 0;
  44. pointer-events: none;
  45. background-color: white;
  46. text-align: center;
  47. border-radius: 5px;
  48. position: static;
  49. margin: 20px auto;
  50. display: inline-block;
  51. vertical-align: middle;
  52. transform: scale(1);
  53. transform-origin: 50% 50%;
  54. z-index: 10001;
  55. transition: transform 0.3s, opacity 0.2s;
  56. @media all and (max-width: 500px) {
  57. width: calc(100% - 20px);
  58. }
  59. }
  60. @keyframes showSweetAlert {
  61. 0% {
  62. transform: scale(1);
  63. }
  64. 1% {
  65. transform: scale(0.5);
  66. }
  67. 45% {
  68. transform: scale(1.05);
  69. }
  70. 80% {
  71. transform: scale(0.95);
  72. }
  73. 100% {
  74. transform: scale(1);
  75. }
  76. }
  77. /*
  78. Target IE8-IE10 due to incompability with the css `pointer-event` property.
  79. @see https://github.com/t4t5/sweetalert/issues/863
  80. */
  81. @media screen\0 {
  82. .swal-overlay {
  83. visibility: hidden;
  84. }
  85. .swal-overlay--show-modal {
  86. visibility: visible;
  87. }
  88. .swal-button__loader {
  89. visibility: hidden;
  90. }
  91. .swal-overlay--show-modal .swal-modal {
  92. visibility: visible;
  93. }
  94. .swal-modal {
  95. visibility: hidden;
  96. }
  97. }