|
| 1 | +/* ========================================================= |
| 2 | + astro-consent — FULL THEME + STRUCTURE |
| 3 | + This file is NEVER overwritten. |
| 4 | + ========================================================= */ |
| 5 | + |
| 6 | +:root { |
| 7 | + --cb-font: system-ui, -apple-system, BlinkMacSystemFont, sans-serif; |
| 8 | + |
| 9 | + --cb-bg: var(--bg-primary, #ffffff); |
| 10 | + --cb-border: var(--border-primary, #e5e7eb); |
| 11 | + --cb-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); |
| 12 | + |
| 13 | + --cb-text: var(--text-primary, #111827); |
| 14 | + --cb-muted: var(--text-muted, #6b7280); |
| 15 | + --cb-link: #a855f7; |
| 16 | + |
| 17 | + --cb-radius: 16px; |
| 18 | + --cb-btn-radius: 999px; |
| 19 | + --cb-btn-padding: 10px 18px; |
| 20 | + |
| 21 | + --cb-accept-bg: #9333ea; |
| 22 | + --cb-accept-text: #ffffff; |
| 23 | + |
| 24 | + --cb-reject-bg: var(--cb-border); |
| 25 | + --cb-reject-text: var(--cb-text); |
| 26 | + |
| 27 | + --cb-manage-bg: transparent; |
| 28 | + --cb-manage-text: var(--cb-text); |
| 29 | + --cb-manage-border: var(--cb-border); |
| 30 | + |
| 31 | + --cb-modal-bg: var(--cb-bg); |
| 32 | + --cb-modal-backdrop: rgba(0, 0, 0, 0.45); |
| 33 | + --cb-modal-radius: 18px; |
| 34 | + --cb-modal-width: 480px; |
| 35 | + |
| 36 | + --cb-toggle-off-bg: var(--cb-border); |
| 37 | + --cb-toggle-on-bg: #9333ea; |
| 38 | + --cb-toggle-knob: #ffffff; |
| 39 | +} |
| 40 | + |
| 41 | +/* =============================== |
| 42 | + Dark mode overrides |
| 43 | + =============================== */ |
| 44 | + |
| 45 | +.dark #astro-consent-banner, |
| 46 | +.dark #astro-consent-modal { |
| 47 | + --cb-bg: var(--bg-primary, #030712); |
| 48 | + --cb-border: var(--border-primary, #1f2937); |
| 49 | + --cb-text: var(--text-primary, #f3f4f6); |
| 50 | + --cb-muted: var(--text-muted, #9ca3af); |
| 51 | + --cb-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); |
| 52 | + --cb-modal-backdrop: rgba(0, 0, 0, 0.6); |
| 53 | +} |
| 54 | + |
| 55 | +/* =============================== |
| 56 | + Banner |
| 57 | + =============================== */ |
| 58 | + |
| 59 | +#astro-consent-banner { |
| 60 | + position: fixed; |
| 61 | + left: 16px; |
| 62 | + right: 16px; |
| 63 | + bottom: 16px; |
| 64 | + z-index: 9999; |
| 65 | + font-family: var(--cb-font); |
| 66 | +} |
| 67 | + |
| 68 | +.cb-container { |
| 69 | + max-width: 1200px; |
| 70 | + margin: 0 auto; |
| 71 | + padding: 20px 24px; |
| 72 | + display: flex; |
| 73 | + gap: 24px; |
| 74 | + justify-content: space-between; |
| 75 | + align-items: center; |
| 76 | + |
| 77 | + background: var(--cb-bg); |
| 78 | + border-radius: var(--cb-radius); |
| 79 | + border: 1px solid var(--cb-border); |
| 80 | + box-shadow: var(--cb-shadow); |
| 81 | + color: var(--cb-text); |
| 82 | +} |
| 83 | + |
| 84 | +.cb-title { |
| 85 | + font-size: 16px; |
| 86 | + font-weight: 600; |
| 87 | +} |
| 88 | + |
| 89 | +.cb-desc { |
| 90 | + margin-top: 4px; |
| 91 | + font-size: 14px; |
| 92 | + color: var(--cb-muted); |
| 93 | +} |
| 94 | + |
| 95 | +.cb-desc a { |
| 96 | + color: var(--cb-link); |
| 97 | + text-decoration: none; |
| 98 | +} |
| 99 | + |
| 100 | +.cb-desc a:hover { |
| 101 | + text-decoration: underline; |
| 102 | +} |
| 103 | + |
| 104 | +/* =============================== |
| 105 | + Buttons |
| 106 | + =============================== */ |
| 107 | + |
| 108 | +.cb-actions { |
| 109 | + display: flex; |
| 110 | + gap: 10px; |
| 111 | +} |
| 112 | + |
| 113 | +.cb-actions button { |
| 114 | + padding: var(--cb-btn-padding); |
| 115 | + border-radius: var(--cb-btn-radius); |
| 116 | + border: 1px solid transparent; |
| 117 | + font-size: 14px; |
| 118 | + font-weight: 600; |
| 119 | + cursor: pointer; |
| 120 | +} |
| 121 | + |
| 122 | +.cb-accept { |
| 123 | + background: var(--cb-accept-bg); |
| 124 | + color: var(--cb-accept-text); |
| 125 | +} |
| 126 | + |
| 127 | +.cb-reject { |
| 128 | + background: var(--cb-reject-bg); |
| 129 | + color: var(--cb-reject-text); |
| 130 | +} |
| 131 | + |
| 132 | +.cb-manage { |
| 133 | + background: var(--cb-manage-bg); |
| 134 | + color: var(--cb-manage-text); |
| 135 | + border: 1px solid var(--cb-manage-border); |
| 136 | +} |
| 137 | + |
| 138 | +/* =============================== |
| 139 | + Modal |
| 140 | + =============================== */ |
| 141 | + |
| 142 | +#astro-consent-modal { |
| 143 | + position: fixed; |
| 144 | + inset: 0; |
| 145 | + background: var(--cb-modal-backdrop); |
| 146 | + display: flex; |
| 147 | + align-items: center; |
| 148 | + justify-content: center; |
| 149 | + z-index: 10000; |
| 150 | +} |
| 151 | + |
| 152 | +.cb-modal { |
| 153 | + width: 100%; |
| 154 | + max-width: var(--cb-modal-width); |
| 155 | + background: var(--cb-modal-bg); |
| 156 | + border-radius: var(--cb-modal-radius); |
| 157 | + padding: 28px; |
| 158 | + color: var(--cb-text); |
| 159 | + border: 1px solid var(--cb-border); |
| 160 | +} |
| 161 | + |
| 162 | +/* =============================== |
| 163 | + Modal rows (SPACING FIXED) |
| 164 | + =============================== */ |
| 165 | + |
| 166 | +.cb-row { |
| 167 | + display: flex; |
| 168 | + justify-content: space-between; |
| 169 | + align-items: center; |
| 170 | + gap: 16px; |
| 171 | + padding: 18px 0; |
| 172 | + border-bottom: 1px solid var(--cb-border); |
| 173 | +} |
| 174 | + |
| 175 | +.cb-row:last-of-type { |
| 176 | + border-bottom: 0; |
| 177 | + padding-bottom: 32px; |
| 178 | +} |
| 179 | + |
| 180 | +/* =============================== |
| 181 | + Modal actions |
| 182 | + =============================== */ |
| 183 | + |
| 184 | +.cb-modal .cb-actions { |
| 185 | + margin-top: 24px; |
| 186 | + padding-top: 20px; |
| 187 | + border-top: 1px solid var(--cb-border); |
| 188 | + display: flex; |
| 189 | + justify-content: flex-end; |
| 190 | +} |
| 191 | + |
| 192 | +/* =============================== |
| 193 | + Toggles |
| 194 | + =============================== */ |
| 195 | + |
| 196 | +.cb-toggle { |
| 197 | + width: 44px; |
| 198 | + height: 24px; |
| 199 | + background: var(--cb-toggle-off-bg); |
| 200 | + border-radius: 999px; |
| 201 | + position: relative; |
| 202 | + cursor: pointer; |
| 203 | + flex-shrink: 0; |
| 204 | +} |
| 205 | + |
| 206 | +.cb-toggle span { |
| 207 | + position: absolute; |
| 208 | + width: 18px; |
| 209 | + height: 18px; |
| 210 | + background: var(--cb-toggle-knob); |
| 211 | + border-radius: 50%; |
| 212 | + top: 3px; |
| 213 | + left: 3px; |
| 214 | + transition: transform 0.2s ease; |
| 215 | +} |
| 216 | + |
| 217 | +.cb-toggle.active { |
| 218 | + background: var(--cb-toggle-on-bg); |
| 219 | +} |
| 220 | + |
| 221 | +.cb-toggle.active span { |
| 222 | + transform: translateX(20px); |
| 223 | +} |
| 224 | + |
| 225 | +/* =============================== |
| 226 | + Mobile |
| 227 | + =============================== */ |
| 228 | + |
| 229 | +@media (max-width: 640px) { |
| 230 | + .cb-container { |
| 231 | + flex-direction: column; |
| 232 | + align-items: stretch; |
| 233 | + gap: 16px; |
| 234 | + } |
| 235 | + |
| 236 | + .cb-actions { |
| 237 | + justify-content: flex-end; |
| 238 | + flex-wrap: wrap; |
| 239 | + } |
| 240 | +} |
| 241 | + |
| 242 | +/* =============================== |
| 243 | + Hide unused marketing toggle |
| 244 | + =============================== */ |
| 245 | + |
| 246 | +.cb-toggle[data-key="marketing"] { |
| 247 | + display: none; |
| 248 | +} |
| 249 | + |
| 250 | +.cb-toggle[data-key="marketing"]:has(~ *), |
| 251 | +.cb-row:has(.cb-toggle[data-key="marketing"]) { |
| 252 | + display: none; |
| 253 | +} |
0 commit comments