| 1 | .dialog-backdrop { |
| 2 | position: fixed; |
| 3 | top: 0; |
| 4 | bottom: 0; |
| 5 | left: 0; |
| 6 | right: 0; |
| 7 | background: #8886; |
| 8 | backdrop-filter: blur(2px); |
| 9 | display: flex; |
| 10 | justify-content: center; |
| 11 | align-items: center; |
| 12 | z-index: 1000; |
| 13 | } |
| 14 | .dialog { |
| 15 | background: #fff; /*fallback*/ |
| 16 | background: var(--bg); |
| 17 | padding: .5em; /* legacy */ |
| 18 | padding: max(.5em, 1vw, 2vh); |
| 19 | padding-top: 0; |
| 20 | border-radius: 1em; |
| 21 | position: relative; |
| 22 | margin: 0 3vw; |
| 23 | overflow: hidden; |
| 24 | max-height: calc(100vh - 2em); |
| 25 | display: flex; |
| 26 | flex-direction: column; |
| 27 | justify-content: center; |
| 28 | } |
| 29 | .dialog-icon { |
| 30 | color: #fff; |
| 31 | background-color: var(--color); |
| 32 | position: absolute; |
| 33 | top: 0; |
| 34 | width: 2em; |
| 35 | height: 1.8em; |
| 36 | text-align: center; |
| 37 | border-radius: .8em 0; |
| 38 | } |
| 39 | .dialog-icon-text { |
| 40 | display: flex; |
| 41 | align-items: center; |
| 42 | justify-content: center; |
| 43 | } |
| 44 | .dialog-title { |
| 45 | font-size: 120%; |
| 46 | font-weight: normal; |
| 47 | margin: .3em 0; |
| 48 | padding: 0 0.5em; /* avoid reaching margins */ |
| 49 | min-height: 1.2em; |
| 50 | } |
| 51 | .dialog-closer ~ .dialog-title { |
| 52 | margin-right: 2em; |
| 53 | } |
| 54 | .dialog-type ~ .dialog-title { |
| 55 | margin-left: 2em; |
| 56 | } |
| 57 | .dialog-icon ~ .dialog-title { |
| 58 | text-align: center; |
| 59 | } |
| 60 | .dialog-closer { |
| 61 | border-radius: 0 0.8em; |
| 62 | right: 0; |
| 63 | padding: 0; |
| 64 | background-color: #c88; |
| 65 | } |
| 66 | .dialog-icon ~ .dialog-content { |
| 67 | margin-top: 1em; |
| 68 | } |
| 69 | .dialog-type { |
| 70 | left: 0; |
| 71 | top: 0; |
| 72 | overflow: hidden; |
| 73 | opacity: .7; /* render the idea that's not a button */ |
| 74 | } |
| 75 | .dialog-content { |
| 76 | overflow: auto; |
| 77 | max-height: calc(100vh - 4.5em); |
| 78 | } |
| 79 | .dialog-content p { |
| 80 | white-space: pre-wrap; |
| 81 | margin: .5em 0; |
| 82 | } |
| 83 | .dialog-confirm .dialog-content button { |
| 84 | margin-top: 1em; |
| 85 | } |
| 86 | .dialog-alert-info { |
| 87 | --color: #282 |
| 88 | } |
| 89 | .dialog-alert-warning { |
| 90 | --color: #c91 |
| 91 | } |
| 92 | .dialog-alert-error { |
| 93 | --color: #822; |
| 94 | } |
| 95 | |
| 96 | @media (max-width: 42em) { |
| 97 | .dialog-icon { font-size: 120% } |
| 98 | .dialog-icon ~ .dialog-content { margin-top: 1.5em; } /* account for larger top icons */ |
| 99 | } |
| 100 | |
| 101 | .dialog-prompt label { |
| 102 | display: block; |
| 103 | margin: .5em .1em; |
| 104 | } |