| @@ -1,4 +1,6 @@ | ||
| 1 | +@use 'theme'; | |
| 2 | + | |
| 1 | 3 | .code-snippets-modal { |
| 2 | 4 | .components-modal__header { |
| 3 | 5 | padding-block-end: 24px; |
| 4 | 6 | } |
| @@ -6,9 +8,9 @@ | ||
| 6 | 8 | .components-modal__content { |
| 7 | 9 | padding: 0; |
| 8 | 10 | display: flex; |
| 9 | 11 | flex-flow: column; |
| 10 | - background: #f6f7f7; | |
| 12 | + background: var(--cs-color-surface-subtle); | |
| 11 | 13 | overflow: initial; |
| 12 | 14 | max-inline-size: 100%; |
| 13 | 15 | } |
| 14 | 16 | |
| @@ -27,15 +29,15 @@ | ||
| 27 | 29 | overflow-y: auto; |
| 28 | 30 | } |
| 29 | 31 | |
| 30 | 32 | .modal-footer { |
| 31 | - border-block-start: 1px solid #e2e2e4; | |
| 33 | + border-block-start: 1px solid var(--cs-color-border-subtle); | |
| 32 | 34 | display: flex; |
| 33 | 35 | flex-flow: row-reverse; |
| 34 | 36 | justify-content: space-between; |
| 35 | 37 | align-items: center; |
| 36 | 38 | inset-block-end: 0; |
| 37 | - background: #f6f7f7; | |
| 39 | + background: var(--cs-color-surface-subtle); | |
| 38 | 40 | inline-size: 100%; |
| 39 | 41 | padding: 11px 19px; |
| 40 | 42 | |
| 41 | 43 | .button-link { |
| @@ -50,4 +52,134 @@ | ||
| 50 | 52 | } |
| 51 | 53 | } |
| 52 | 54 | } |
| 53 | 55 | } |
| 56 | + | |
| 57 | +.components-modal__frame.code-snippets-preview-modal { | |
| 58 | + min-inline-size: 520px; | |
| 59 | + min-block-size: 240px; | |
| 60 | + inline-size: var(--cs-preview-modal-inline-size); | |
| 61 | + max-block-size: 85vh; | |
| 62 | + | |
| 63 | + @media (width <= 600px) { | |
| 64 | + min-inline-size: 90vw; | |
| 65 | + } | |
| 66 | + | |
| 67 | + .components-modal__header { | |
| 68 | + border-block-end-color: #ddd; | |
| 69 | + } | |
| 70 | + | |
| 71 | + .code-snippets-preview-modal__badge { | |
| 72 | + display: flex; | |
| 73 | + flex-shrink: 0; | |
| 74 | + margin-inline-end: 8px; | |
| 75 | + } | |
| 76 | + | |
| 77 | + // Header and footer stay pinned; the CodeMirror editor is the only | |
| 78 | + // scroll region, scrolling long code both vertically and horizontally. | |
| 79 | + .components-modal__content { | |
| 80 | + display: flex; | |
| 81 | + flex-flow: column; | |
| 82 | + min-block-size: 0; | |
| 83 | + padding: 0; | |
| 84 | + overflow: hidden; | |
| 85 | + } | |
| 86 | + | |
| 87 | + // Newer Modal versions wrap children in an unstyled focus container. | |
| 88 | + .components-modal__header + div { | |
| 89 | + display: flex; | |
| 90 | + flex-flow: column; | |
| 91 | + flex: 1; | |
| 92 | + min-block-size: 0; | |
| 93 | + overflow: hidden; | |
| 94 | + } | |
| 95 | + | |
| 96 | + .code-snippets-preview-modal__editor { | |
| 97 | + display: flex; | |
| 98 | + flex-flow: column; | |
| 99 | + flex: 1; | |
| 100 | + min-block-size: 0; | |
| 101 | + | |
| 102 | + .CodeMirror { | |
| 103 | + flex: 1; | |
| 104 | + min-block-size: 0; | |
| 105 | + block-size: 100%; | |
| 106 | + } | |
| 107 | + | |
| 108 | + textarea { | |
| 109 | + flex: 1; | |
| 110 | + min-block-size: 0; | |
| 111 | + inline-size: 100%; | |
| 112 | + resize: none; | |
| 113 | + font-family: monospace; | |
| 114 | + } | |
| 115 | + } | |
| 116 | + | |
| 117 | + .code-snippets-preview-modal__footer { | |
| 118 | + display: flex; | |
| 119 | + align-items: center; | |
| 120 | + justify-content: space-between; | |
| 121 | + flex-wrap: wrap; | |
| 122 | + flex-shrink: 0; | |
| 123 | + gap: 16px; | |
| 124 | + padding: 11px 19px; | |
| 125 | + border-block-start: 1px solid var(--cs-color-border-subtle); | |
| 126 | + background: var(--cs-color-surface-subtle); | |
| 127 | + } | |
| 128 | + | |
| 129 | + .code-snippets-preview-modal__priority { | |
| 130 | + display: flex; | |
| 131 | + align-items: center; | |
| 132 | + gap: 8px; | |
| 133 | + font-size: 14px; | |
| 134 | + color: var(--cs-color-text-muted); | |
| 135 | + | |
| 136 | + .code-snippets-preview-modal__priority-value { | |
| 137 | + font-weight: 600; | |
| 138 | + color: var(--cs-color-text); | |
| 139 | + } | |
| 140 | + } | |
| 141 | + | |
| 142 | + .code-snippets-preview-modal__buttons { | |
| 143 | + display: flex; | |
| 144 | + align-items: center; | |
| 145 | + flex-wrap: wrap; | |
| 146 | + gap: 8px; | |
| 147 | + | |
| 148 | + .button { | |
| 149 | + border-radius: 5px; | |
| 150 | + font-size: 14px; | |
| 151 | + } | |
| 152 | + | |
| 153 | + .button-link.code-snippets-preview-modal__trash { | |
| 154 | + min-block-size: 38px; | |
| 155 | + padding-block: 0; | |
| 156 | + padding-inline: 16px; | |
| 157 | + border: 1px solid var(--cs-color-error); | |
| 158 | + border-radius: 5px; | |
| 159 | + background: var(--cs-color-surface-subtle); | |
| 160 | + line-height: 2.5715; | |
| 161 | + font-weight: 400; | |
| 162 | + color: var(--cs-color-error); | |
| 163 | + text-decoration: none; | |
| 164 | + | |
| 165 | + &:hover, | |
| 166 | + &:focus { | |
| 167 | + border-color: var(--cs-color-error); | |
| 168 | + background: var(--cs-color-surface-muted); | |
| 169 | + color: var(--cs-color-error); | |
| 170 | + } | |
| 171 | + } | |
| 172 | + } | |
| 173 | +} | |
| 174 | + | |
| 175 | +.components-modal__content { | |
| 176 | + .action-buttons { | |
| 177 | + display: flex; | |
| 178 | + justify-content: flex-end; | |
| 179 | + } | |
| 180 | + | |
| 181 | + .components-button.is-secondary { | |
| 182 | + box-shadow: none; | |
| 183 | + } | |
| 184 | +} | |
| 185 | + | |