_dialog.scss 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. .w-dialog {
  2. position: fixed;
  3. display: flex;
  4. inset-inline-start: 0;
  5. inset-inline-end: 0;
  6. bottom: 0;
  7. top: 0;
  8. z-index: theme('zIndex.dialog');
  9. padding: theme('spacing.4');
  10. &[aria-hidden='true'] {
  11. display: none;
  12. }
  13. &__overlay {
  14. position: fixed;
  15. inset-inline-start: 0;
  16. inset-inline-end: 0;
  17. bottom: 0;
  18. top: 0;
  19. opacity: theme('opacity.40');
  20. background: theme('colors.black.DEFAULT');
  21. }
  22. &__box {
  23. width: 100%;
  24. position: relative;
  25. margin: auto;
  26. overflow: hidden;
  27. max-width: theme('maxWidth.2xl');
  28. z-index: theme('zIndex.dialog');
  29. background: theme('colors.white.DEFAULT');
  30. box-shadow: theme('boxShadow.DEFAULT');
  31. border-radius: theme('borderRadius.md');
  32. animation: theme('animation.fade-in');
  33. @include media-breakpoint-up(sm) {
  34. width: 600px;
  35. }
  36. }
  37. &__close-button {
  38. position: absolute;
  39. display: inline-flex;
  40. justify-content: center;
  41. align-items: center;
  42. background: transparent;
  43. padding: 0;
  44. top: theme('spacing.2');
  45. inset-inline-end: theme('spacing.2');
  46. width: theme('spacing.12');
  47. height: theme('spacing.12');
  48. }
  49. &__close-icon {
  50. width: theme('spacing.4');
  51. height: theme('spacing.4');
  52. color: theme('colors.grey.600');
  53. }
  54. &__content {
  55. // Using apply for scrollbars to avoid having to overwrite scrollbar with excess css
  56. overflow: auto;
  57. padding: theme('spacing.8');
  58. max-height: calc(100vh - 180px);
  59. @include media-breakpoint-up(sm) {
  60. padding: theme('spacing.12');
  61. }
  62. @include media-breakpoint-up(md) {
  63. padding-inline-start: theme('spacing.20');
  64. padding-inline-end: theme('spacing.20');
  65. }
  66. }
  67. &__icon {
  68. position: absolute;
  69. display: none;
  70. width: theme('spacing.5');
  71. height: theme('spacing.5');
  72. color: theme('colors.primary.DEFAULT');
  73. top: theme('spacing.[0.5]');
  74. transform: translateY(theme('spacing.2'));
  75. inset-inline-start: calc(0 - theme('spacing.10'));
  76. @include media-breakpoint-up(md) {
  77. display: block;
  78. }
  79. }
  80. &__title {
  81. position: relative;
  82. margin-top: 0;
  83. margin-bottom: theme('spacing.1');
  84. }
  85. &__subtitle {
  86. margin-bottom: theme('spacing.4');
  87. }
  88. &__message {
  89. display: flex;
  90. align-items: center;
  91. padding: theme('spacing.5');
  92. &--info {
  93. background: theme('colors.info.50');
  94. color: theme('colors.info.100');
  95. }
  96. &--warning {
  97. background: theme('colors.warning.50');
  98. color: theme('colors.primary.DEFAULT');
  99. }
  100. &--critical {
  101. background: theme('colors.critical.50');
  102. color: theme('colors.critical.200');
  103. }
  104. &--success {
  105. background: theme('colors.positive.50');
  106. color: theme('colors.positive.100');
  107. }
  108. }
  109. &__message-icon {
  110. width: theme('spacing.5');
  111. height: theme('spacing.5');
  112. flex-shrink: 0;
  113. }
  114. &__message-header {
  115. margin-inline-start: theme('spacing[2.5]');
  116. padding-inline-end: theme('spacing.8');
  117. color: theme('colors.grey.600');
  118. font-size: theme('fontSize.14');
  119. }
  120. &__message-description {
  121. margin-bottom: 0;
  122. }
  123. }