astro-consent 1.0.7 → 1.0.8
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.
- package/dist/cli.cjs +149 -4
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -88,12 +88,12 @@ if (!fs.existsSync(cssDir)) {
|
|
|
88
88
|
fs.mkdirSync(cssDir, { recursive: true });
|
|
89
89
|
}
|
|
90
90
|
/* ─────────────────────────────────────
|
|
91
|
-
Create CSS
|
|
91
|
+
Create CSS file ONCE (variables + selectors)
|
|
92
92
|
───────────────────────────────────── */
|
|
93
93
|
if (!fs.existsSync(cssFile)) {
|
|
94
94
|
fs.writeFileSync(cssFile, `/* =========================================================
|
|
95
|
-
astro-consent — FULL THEME
|
|
96
|
-
This file is NEVER overwritten
|
|
95
|
+
astro-consent — FULL THEME + STRUCTURE
|
|
96
|
+
This file is NEVER overwritten.
|
|
97
97
|
========================================================= */
|
|
98
98
|
|
|
99
99
|
:root {
|
|
@@ -130,11 +130,156 @@ if (!fs.existsSync(cssFile)) {
|
|
|
130
130
|
--cb-toggle-on-bg: #22c55e;
|
|
131
131
|
--cb-toggle-knob: #ffffff;
|
|
132
132
|
}
|
|
133
|
+
|
|
134
|
+
/* ===============================
|
|
135
|
+
Banner
|
|
136
|
+
=============================== */
|
|
137
|
+
|
|
138
|
+
#astro-consent-banner {
|
|
139
|
+
position: fixed;
|
|
140
|
+
left: 16px;
|
|
141
|
+
right: 16px;
|
|
142
|
+
bottom: 16px;
|
|
143
|
+
z-index: 9999;
|
|
144
|
+
font-family: var(--cb-font);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.cb-container {
|
|
148
|
+
max-width: 1200px;
|
|
149
|
+
margin: 0 auto;
|
|
150
|
+
padding: 20px 24px;
|
|
151
|
+
display: flex;
|
|
152
|
+
gap: 24px;
|
|
153
|
+
justify-content: space-between;
|
|
154
|
+
align-items: center;
|
|
155
|
+
|
|
156
|
+
background: var(--cb-bg);
|
|
157
|
+
border-radius: var(--cb-radius);
|
|
158
|
+
border: 1px solid var(--cb-border);
|
|
159
|
+
box-shadow: var(--cb-shadow);
|
|
160
|
+
color: var(--cb-text);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.cb-title {
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
font-weight: 600;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.cb-desc {
|
|
169
|
+
font-size: 14px;
|
|
170
|
+
color: var(--cb-muted);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.cb-desc a {
|
|
174
|
+
color: var(--cb-link);
|
|
175
|
+
text-decoration: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* ===============================
|
|
179
|
+
Buttons
|
|
180
|
+
=============================== */
|
|
181
|
+
|
|
182
|
+
.cb-actions {
|
|
183
|
+
display: flex;
|
|
184
|
+
gap: 10px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.cb-actions button {
|
|
188
|
+
padding: var(--cb-btn-padding);
|
|
189
|
+
border-radius: var(--cb-btn-radius);
|
|
190
|
+
border: 0;
|
|
191
|
+
font-size: 14px;
|
|
192
|
+
font-weight: 600;
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.cb-accept {
|
|
197
|
+
background: var(--cb-accept-bg);
|
|
198
|
+
color: var(--cb-accept-text);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.cb-reject {
|
|
202
|
+
background: var(--cb-reject-bg);
|
|
203
|
+
color: var(--cb-reject-text);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.cb-manage {
|
|
207
|
+
background: var(--cb-manage-bg);
|
|
208
|
+
color: var(--cb-manage-text);
|
|
209
|
+
border: 1px solid var(--cb-manage-border);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* ===============================
|
|
213
|
+
Modal
|
|
214
|
+
=============================== */
|
|
215
|
+
|
|
216
|
+
#astro-consent-modal {
|
|
217
|
+
position: fixed;
|
|
218
|
+
inset: 0;
|
|
219
|
+
background: var(--cb-modal-backdrop);
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
justify-content: center;
|
|
223
|
+
z-index: 10000;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.cb-modal {
|
|
227
|
+
width: 100%;
|
|
228
|
+
max-width: var(--cb-modal-width);
|
|
229
|
+
background: var(--cb-modal-bg);
|
|
230
|
+
border-radius: var(--cb-modal-radius);
|
|
231
|
+
padding: 24px;
|
|
232
|
+
color: var(--cb-text);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* ===============================
|
|
236
|
+
Toggles
|
|
237
|
+
=============================== */
|
|
238
|
+
|
|
239
|
+
.cb-toggle {
|
|
240
|
+
width: 44px;
|
|
241
|
+
height: 24px;
|
|
242
|
+
background: var(--cb-toggle-off-bg);
|
|
243
|
+
border-radius: 999px;
|
|
244
|
+
position: relative;
|
|
245
|
+
cursor: pointer;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.cb-toggle span {
|
|
249
|
+
position: absolute;
|
|
250
|
+
width: 18px;
|
|
251
|
+
height: 18px;
|
|
252
|
+
background: var(--cb-toggle-knob);
|
|
253
|
+
border-radius: 50%;
|
|
254
|
+
top: 3px;
|
|
255
|
+
left: 3px;
|
|
256
|
+
transition: transform 0.2s ease;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.cb-toggle.active {
|
|
260
|
+
background: var(--cb-toggle-on-bg);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.cb-toggle.active span {
|
|
264
|
+
transform: translateX(20px);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* ===============================
|
|
268
|
+
Mobile
|
|
269
|
+
=============================== */
|
|
270
|
+
|
|
271
|
+
@media (max-width: 640px) {
|
|
272
|
+
.cb-container {
|
|
273
|
+
flex-direction: column;
|
|
274
|
+
align-items: stretch;
|
|
275
|
+
gap: 16px;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
133
278
|
`, "utf8");
|
|
134
279
|
console.log("🎨 Created src/cookiebanner.css");
|
|
135
280
|
}
|
|
136
281
|
/* ─────────────────────────────────────
|
|
137
|
-
Inject Astro integration
|
|
282
|
+
Inject Astro integration
|
|
138
283
|
───────────────────────────────────── */
|
|
139
284
|
if (!source.includes(`from "astro-consent"`)) {
|
|
140
285
|
source = `import astroConsent from "astro-consent";\n${source}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-consent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
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": {
|