astro-consent 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.cjs +63 -20
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -59,6 +59,7 @@ function exitWith(message, code = 1) {
59
59
  }
60
60
  /* ─────────────────────────────────────
61
61
  Locate astro.config
62
+
62
63
  ───────────────────────────────────── */
63
64
  const configPath = findAstroConfig();
64
65
  if (!configPath) {
@@ -88,7 +89,7 @@ if (!fs.existsSync(cssDir)) {
88
89
  fs.mkdirSync(cssDir, { recursive: true });
89
90
  }
90
91
  /* ─────────────────────────────────────
91
- Create CSS file ONCE (variables + selectors)
92
+ Create CSS file ONCE (theme + structure)
92
93
  ───────────────────────────────────── */
93
94
  if (!fs.existsSync(cssFile)) {
94
95
  fs.writeFileSync(cssFile, `/* =========================================================
@@ -99,35 +100,35 @@ if (!fs.existsSync(cssFile)) {
99
100
  :root {
100
101
  --cb-font: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
101
102
 
102
- --cb-bg: #0c1220;
103
- --cb-border: rgba(255,255,255,0.08);
104
- --cb-text: #ffffff;
105
- --cb-muted: #9ca3af;
106
- --cb-link: #60a5fa;
103
+ --cb-bg: var(--color-surface, #0c1220);
104
+ --cb-border: var(--color-border, rgba(255,255,255,0.08));
105
+ --cb-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
107
106
 
108
- --cb-radius: 16px;
109
- --cb-shadow: 0 20px 40px rgba(0,0,0,0.35);
107
+ --cb-text: var(--color-text, #ffffff);
108
+ --cb-muted: var(--color-muted, #9ca3af);
109
+ --cb-link: var(--color-primary, #60a5fa);
110
110
 
111
+ --cb-radius: 16px;
111
112
  --cb-btn-radius: 999px;
112
113
  --cb-btn-padding: 10px 18px;
113
114
 
114
- --cb-accept-bg: #22c55e;
115
- --cb-accept-text: #052e16;
115
+ --cb-accept-bg: var(--color-cta, #22c55e);
116
+ --cb-accept-text: #ffffff;
116
117
 
117
- --cb-reject-bg: #374151;
118
- --cb-reject-text: #ffffff;
118
+ --cb-reject-bg: var(--cb-border);
119
+ --cb-reject-text: var(--cb-text);
119
120
 
120
121
  --cb-manage-bg: transparent;
121
- --cb-manage-text: #ffffff;
122
- --cb-manage-border: rgba(255,255,255,0.15);
122
+ --cb-manage-text: var(--cb-text);
123
+ --cb-manage-border: var(--cb-border);
123
124
 
124
- --cb-modal-bg: #0c1220;
125
- --cb-modal-backdrop: rgba(0,0,0,0.55);
125
+ --cb-modal-bg: var(--cb-bg);
126
+ --cb-modal-backdrop: rgba(15, 23, 42, 0.45);
126
127
  --cb-modal-radius: 18px;
127
128
  --cb-modal-width: 480px;
128
129
 
129
- --cb-toggle-off-bg: #374151;
130
- --cb-toggle-on-bg: #22c55e;
130
+ --cb-toggle-off-bg: var(--cb-border);
131
+ --cb-toggle-on-bg: var(--color-accent, #22c55e);
131
132
  --cb-toggle-knob: #ffffff;
132
133
  }
133
134
 
@@ -166,6 +167,7 @@ if (!fs.existsSync(cssFile)) {
166
167
  }
167
168
 
168
169
  .cb-desc {
170
+ margin-top: 4px;
169
171
  font-size: 14px;
170
172
  color: var(--cb-muted);
171
173
  }
@@ -175,6 +177,10 @@ if (!fs.existsSync(cssFile)) {
175
177
  text-decoration: none;
176
178
  }
177
179
 
180
+ .cb-desc a:hover {
181
+ text-decoration: underline;
182
+ }
183
+
178
184
  /* ===============================
179
185
  Buttons
180
186
  =============================== */
@@ -187,7 +193,7 @@ if (!fs.existsSync(cssFile)) {
187
193
  .cb-actions button {
188
194
  padding: var(--cb-btn-padding);
189
195
  border-radius: var(--cb-btn-radius);
190
- border: 0;
196
+ border: 1px solid transparent;
191
197
  font-size: 14px;
192
198
  font-weight: 600;
193
199
  cursor: pointer;
@@ -228,8 +234,39 @@ if (!fs.existsSync(cssFile)) {
228
234
  max-width: var(--cb-modal-width);
229
235
  background: var(--cb-modal-bg);
230
236
  border-radius: var(--cb-modal-radius);
231
- padding: 24px;
237
+ padding: 28px;
232
238
  color: var(--cb-text);
239
+ border: 1px solid var(--cb-border);
240
+ }
241
+
242
+ /* ===============================
243
+ Modal rows (SPACING FIXED)
244
+ =============================== */
245
+
246
+ .cb-row {
247
+ display: flex;
248
+ justify-content: space-between;
249
+ align-items: center;
250
+ gap: 16px;
251
+ padding: 18px 0;
252
+ border-bottom: 1px solid var(--cb-border);
253
+ }
254
+
255
+ .cb-row:last-of-type {
256
+ border-bottom: 0;
257
+ padding-bottom: 32px;
258
+ }
259
+
260
+ /* ===============================
261
+ Modal actions
262
+ =============================== */
263
+
264
+ .cb-modal .cb-actions {
265
+ margin-top: 24px;
266
+ padding-top: 20px;
267
+ border-top: 1px solid var(--cb-border);
268
+ display: flex;
269
+ justify-content: flex-end;
233
270
  }
234
271
 
235
272
  /* ===============================
@@ -243,6 +280,7 @@ if (!fs.existsSync(cssFile)) {
243
280
  border-radius: 999px;
244
281
  position: relative;
245
282
  cursor: pointer;
283
+ flex-shrink: 0;
246
284
  }
247
285
 
248
286
  .cb-toggle span {
@@ -274,6 +312,11 @@ if (!fs.existsSync(cssFile)) {
274
312
  align-items: stretch;
275
313
  gap: 16px;
276
314
  }
315
+
316
+ .cb-actions {
317
+ justify-content: flex-end;
318
+ flex-wrap: wrap;
319
+ }
277
320
  }
278
321
  `, "utf8");
279
322
  console.log("🎨 Created src/cookiebanner.css");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-consent",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "A privacy-first, GDPR-compliant cookie consent banner for Astro with a built-in preferences modal, zero dependencies, and full theme control.",
5
5
  "type": "module",
6
6
  "author": {