create-rubrica 0.3.3 → 0.3.4
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/index.js +23 -225
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -215,236 +215,32 @@ async function applyLayout(layout, options, fsModule = defaultFs) {
|
|
|
215
215
|
import * as nodeFsPromises2 from "fs/promises";
|
|
216
216
|
var PRESETS = {
|
|
217
217
|
"editorial-cream": {
|
|
218
|
-
root: ` --
|
|
219
|
-
--
|
|
220
|
-
--
|
|
221
|
-
--
|
|
222
|
-
|
|
223
|
-
--popover-foreground: 24 10% 10%;
|
|
224
|
-
--primary: 35 90% 50%;
|
|
225
|
-
--primary-foreground: 0 0% 100%;
|
|
226
|
-
--secondary: 38 25% 90%;
|
|
227
|
-
--secondary-foreground: 24 10% 10%;
|
|
228
|
-
--muted: 38 25% 90%;
|
|
229
|
-
--muted-foreground: 24 8% 45%;
|
|
230
|
-
--accent: 38 25% 90%;
|
|
231
|
-
--accent-foreground: 24 10% 10%;
|
|
232
|
-
--destructive: 0 84% 60%;
|
|
233
|
-
--destructive-foreground: 0 0% 100%;
|
|
234
|
-
--border: 35 20% 85%;
|
|
235
|
-
--input: 35 20% 85%;
|
|
236
|
-
--ring: 35 90% 50%;
|
|
237
|
-
--sidebar: 38 30% 94%;
|
|
238
|
-
--sidebar-foreground: 24 8% 45%;
|
|
239
|
-
--sidebar-primary: 35 90% 50%;
|
|
240
|
-
--sidebar-primary-foreground: 0 0% 100%;
|
|
241
|
-
--sidebar-accent: 38 25% 90%;
|
|
242
|
-
--sidebar-accent-foreground: 24 10% 10%;
|
|
243
|
-
--sidebar-border: 35 20% 85%;
|
|
244
|
-
--sidebar-ring: 35 90% 50%;
|
|
245
|
-
--neon-purple: 35 90% 50%;
|
|
246
|
-
--neon-lime: 45 93% 47%;`,
|
|
247
|
-
dark: ` --background: 25 20% 8%;
|
|
248
|
-
--foreground: 38 20% 90%;
|
|
249
|
-
--card: 25 18% 12%;
|
|
250
|
-
--card-foreground: 38 20% 90%;
|
|
251
|
-
--popover: 25 18% 12%;
|
|
252
|
-
--popover-foreground: 38 20% 90%;
|
|
253
|
-
--primary: 35 90% 50%;
|
|
254
|
-
--primary-foreground: 0 0% 100%;
|
|
255
|
-
--secondary: 25 15% 18%;
|
|
256
|
-
--secondary-foreground: 38 20% 90%;
|
|
257
|
-
--muted: 25 15% 18%;
|
|
258
|
-
--muted-foreground: 35 10% 55%;
|
|
259
|
-
--accent: 25 15% 18%;
|
|
260
|
-
--accent-foreground: 38 20% 90%;
|
|
261
|
-
--destructive: 0 62% 50%;
|
|
262
|
-
--destructive-foreground: 0 0% 100%;
|
|
263
|
-
--border: 25 15% 18%;
|
|
264
|
-
--input: 25 15% 18%;
|
|
265
|
-
--ring: 35 90% 50%;
|
|
266
|
-
--sidebar: 25 20% 6%;
|
|
267
|
-
--sidebar-foreground: 35 10% 55%;
|
|
268
|
-
--sidebar-primary: 35 90% 50%;
|
|
269
|
-
--sidebar-primary-foreground: 0 0% 100%;
|
|
270
|
-
--sidebar-accent: 25 15% 18%;
|
|
271
|
-
--sidebar-accent-foreground: 38 20% 90%;
|
|
272
|
-
--sidebar-border: 25 15% 18%;
|
|
273
|
-
--sidebar-ring: 35 90% 50%;`
|
|
218
|
+
root: ` --bg: #faf7f2;
|
|
219
|
+
--text: #1a1614;
|
|
220
|
+
--primary: #a855f7;
|
|
221
|
+
--accent: #ef4444;`,
|
|
222
|
+
dark: ``
|
|
274
223
|
},
|
|
275
224
|
"paper-noir": {
|
|
276
|
-
root: ` --
|
|
277
|
-
--
|
|
278
|
-
--
|
|
279
|
-
--
|
|
280
|
-
|
|
281
|
-
--popover-foreground: 0 0% 5%;
|
|
282
|
-
--primary: 0 84% 50%;
|
|
283
|
-
--primary-foreground: 0 0% 100%;
|
|
284
|
-
--secondary: 0 0% 92%;
|
|
285
|
-
--secondary-foreground: 0 0% 5%;
|
|
286
|
-
--muted: 0 0% 92%;
|
|
287
|
-
--muted-foreground: 0 0% 40%;
|
|
288
|
-
--accent: 0 0% 92%;
|
|
289
|
-
--accent-foreground: 0 0% 5%;
|
|
290
|
-
--destructive: 0 84% 60%;
|
|
291
|
-
--destructive-foreground: 0 0% 100%;
|
|
292
|
-
--border: 0 0% 88%;
|
|
293
|
-
--input: 0 0% 88%;
|
|
294
|
-
--ring: 0 84% 50%;
|
|
295
|
-
--sidebar: 0 0% 96%;
|
|
296
|
-
--sidebar-foreground: 0 0% 40%;
|
|
297
|
-
--sidebar-primary: 0 84% 50%;
|
|
298
|
-
--sidebar-primary-foreground: 0 0% 100%;
|
|
299
|
-
--sidebar-accent: 0 0% 92%;
|
|
300
|
-
--sidebar-accent-foreground: 0 0% 5%;
|
|
301
|
-
--sidebar-border: 0 0% 88%;
|
|
302
|
-
--sidebar-ring: 0 84% 50%;
|
|
303
|
-
--neon-purple: 0 84% 50%;
|
|
304
|
-
--neon-lime: 0 0% 20%;`,
|
|
305
|
-
dark: ` --background: 0 0% 5%;
|
|
306
|
-
--foreground: 0 0% 95%;
|
|
307
|
-
--card: 0 0% 8%;
|
|
308
|
-
--card-foreground: 0 0% 95%;
|
|
309
|
-
--popover: 0 0% 8%;
|
|
310
|
-
--popover-foreground: 0 0% 95%;
|
|
311
|
-
--primary: 0 84% 50%;
|
|
312
|
-
--primary-foreground: 0 0% 100%;
|
|
313
|
-
--secondary: 0 0% 12%;
|
|
314
|
-
--secondary-foreground: 0 0% 95%;
|
|
315
|
-
--muted: 0 0% 12%;
|
|
316
|
-
--muted-foreground: 0 0% 60%;
|
|
317
|
-
--accent: 0 0% 12%;
|
|
318
|
-
--accent-foreground: 0 0% 95%;
|
|
319
|
-
--destructive: 0 62% 50%;
|
|
320
|
-
--destructive-foreground: 0 0% 100%;
|
|
321
|
-
--border: 0 0% 15%;
|
|
322
|
-
--input: 0 0% 15%;
|
|
323
|
-
--ring: 0 84% 50%;
|
|
324
|
-
--sidebar: 0 0% 3%;
|
|
325
|
-
--sidebar-foreground: 0 0% 60%;
|
|
326
|
-
--sidebar-primary: 0 84% 50%;
|
|
327
|
-
--sidebar-primary-foreground: 0 0% 100%;
|
|
328
|
-
--sidebar-accent: 0 0% 12%;
|
|
329
|
-
--sidebar-accent-foreground: 0 0% 95%;
|
|
330
|
-
--sidebar-border: 0 0% 15%;
|
|
331
|
-
--sidebar-ring: 0 84% 50%;`
|
|
225
|
+
root: ` --bg: #f0eee9;
|
|
226
|
+
--text: #0a0a0a;
|
|
227
|
+
--primary: #ef4444;
|
|
228
|
+
--accent: #3b82f6;`,
|
|
229
|
+
dark: ``
|
|
332
230
|
},
|
|
333
231
|
"midnight-blue": {
|
|
334
|
-
root: ` --
|
|
335
|
-
--
|
|
336
|
-
--
|
|
337
|
-
--
|
|
338
|
-
|
|
339
|
-
--popover-foreground: 210 40% 96%;
|
|
340
|
-
--primary: 220 90% 56%;
|
|
341
|
-
--primary-foreground: 0 0% 100%;
|
|
342
|
-
--secondary: 217 33% 17%;
|
|
343
|
-
--secondary-foreground: 210 40% 96%;
|
|
344
|
-
--muted: 217 33% 17%;
|
|
345
|
-
--muted-foreground: 215 20% 65%;
|
|
346
|
-
--accent: 217 33% 17%;
|
|
347
|
-
--accent-foreground: 210 40% 96%;
|
|
348
|
-
--destructive: 0 62% 50%;
|
|
349
|
-
--destructive-foreground: 0 0% 100%;
|
|
350
|
-
--border: 217 33% 17%;
|
|
351
|
-
--input: 217 33% 17%;
|
|
352
|
-
--ring: 220 90% 56%;
|
|
353
|
-
--sidebar: 222 47% 6%;
|
|
354
|
-
--sidebar-foreground: 215 20% 65%;
|
|
355
|
-
--sidebar-primary: 220 90% 56%;
|
|
356
|
-
--sidebar-primary-foreground: 0 0% 100%;
|
|
357
|
-
--sidebar-accent: 217 33% 17%;
|
|
358
|
-
--sidebar-accent-foreground: 210 40% 96%;
|
|
359
|
-
--sidebar-border: 217 33% 17%;
|
|
360
|
-
--sidebar-ring: 220 90% 56%;
|
|
361
|
-
--neon-purple: 220 90% 56%;
|
|
362
|
-
--neon-lime: 190 90% 50%;`,
|
|
363
|
-
dark: ` --background: 220 14% 5%;
|
|
364
|
-
--foreground: 210 40% 96%;
|
|
365
|
-
--card: 222 47% 8%;
|
|
366
|
-
--card-foreground: 210 40% 96%;
|
|
367
|
-
--popover: 222 47% 8%;
|
|
368
|
-
--popover-foreground: 210 40% 96%;
|
|
369
|
-
--primary: 220 90% 56%;
|
|
370
|
-
--primary-foreground: 0 0% 100%;
|
|
371
|
-
--secondary: 217 33% 13%;
|
|
372
|
-
--secondary-foreground: 210 40% 96%;
|
|
373
|
-
--muted: 217 33% 13%;
|
|
374
|
-
--muted-foreground: 215 20% 65%;
|
|
375
|
-
--accent: 217 33% 13%;
|
|
376
|
-
--accent-foreground: 210 40% 96%;
|
|
377
|
-
--destructive: 0 62% 50%;
|
|
378
|
-
--destructive-foreground: 0 0% 100%;
|
|
379
|
-
--border: 217 33% 13%;
|
|
380
|
-
--input: 217 33% 13%;
|
|
381
|
-
--ring: 220 90% 56%;
|
|
382
|
-
--sidebar: 222 47% 3%;
|
|
383
|
-
--sidebar-foreground: 215 20% 65%;
|
|
384
|
-
--sidebar-primary: 220 90% 56%;
|
|
385
|
-
--sidebar-primary-foreground: 0 0% 100%;
|
|
386
|
-
--sidebar-accent: 217 33% 13%;
|
|
387
|
-
--sidebar-accent-foreground: 210 40% 96%;
|
|
388
|
-
--sidebar-border: 217 33% 13%;
|
|
389
|
-
--sidebar-ring: 220 90% 56%;`
|
|
232
|
+
root: ` --bg: #0a1224;
|
|
233
|
+
--text: #e8e6e0;
|
|
234
|
+
--primary: #06b6d4;
|
|
235
|
+
--accent: #facc15;`,
|
|
236
|
+
dark: ``
|
|
390
237
|
},
|
|
391
238
|
"solar-warm": {
|
|
392
|
-
root: ` --
|
|
393
|
-
--
|
|
394
|
-
--
|
|
395
|
-
--
|
|
396
|
-
|
|
397
|
-
--popover-foreground: 35 30% 92%;
|
|
398
|
-
--primary: 25 95% 53%;
|
|
399
|
-
--primary-foreground: 0 0% 100%;
|
|
400
|
-
--secondary: 20 25% 18%;
|
|
401
|
-
--secondary-foreground: 35 30% 92%;
|
|
402
|
-
--muted: 20 25% 18%;
|
|
403
|
-
--muted-foreground: 30 15% 60%;
|
|
404
|
-
--accent: 20 25% 18%;
|
|
405
|
-
--accent-foreground: 35 30% 92%;
|
|
406
|
-
--destructive: 0 62% 50%;
|
|
407
|
-
--destructive-foreground: 0 0% 100%;
|
|
408
|
-
--border: 20 25% 18%;
|
|
409
|
-
--input: 20 25% 18%;
|
|
410
|
-
--ring: 25 95% 53%;
|
|
411
|
-
--sidebar: 20 30% 6%;
|
|
412
|
-
--sidebar-foreground: 30 15% 60%;
|
|
413
|
-
--sidebar-primary: 25 95% 53%;
|
|
414
|
-
--sidebar-primary-foreground: 0 0% 100%;
|
|
415
|
-
--sidebar-accent: 20 25% 18%;
|
|
416
|
-
--sidebar-accent-foreground: 35 30% 92%;
|
|
417
|
-
--sidebar-border: 20 25% 18%;
|
|
418
|
-
--sidebar-ring: 25 95% 53%;
|
|
419
|
-
--neon-purple: 25 95% 53%;
|
|
420
|
-
--neon-lime: 45 93% 47%;`,
|
|
421
|
-
dark: ` --background: 20 35% 5%;
|
|
422
|
-
--foreground: 35 30% 92%;
|
|
423
|
-
--card: 20 30% 8%;
|
|
424
|
-
--card-foreground: 35 30% 92%;
|
|
425
|
-
--popover: 20 30% 8%;
|
|
426
|
-
--popover-foreground: 35 30% 92%;
|
|
427
|
-
--primary: 25 95% 53%;
|
|
428
|
-
--primary-foreground: 0 0% 100%;
|
|
429
|
-
--secondary: 20 30% 13%;
|
|
430
|
-
--secondary-foreground: 35 30% 92%;
|
|
431
|
-
--muted: 20 30% 13%;
|
|
432
|
-
--muted-foreground: 30 15% 60%;
|
|
433
|
-
--accent: 20 30% 13%;
|
|
434
|
-
--accent-foreground: 35 30% 92%;
|
|
435
|
-
--destructive: 0 62% 50%;
|
|
436
|
-
--destructive-foreground: 0 0% 100%;
|
|
437
|
-
--border: 20 30% 13%;
|
|
438
|
-
--input: 20 30% 13%;
|
|
439
|
-
--ring: 25 95% 53%;
|
|
440
|
-
--sidebar: 20 35% 3%;
|
|
441
|
-
--sidebar-foreground: 30 15% 60%;
|
|
442
|
-
--sidebar-primary: 25 95% 53%;
|
|
443
|
-
--sidebar-primary-foreground: 0 0% 100%;
|
|
444
|
-
--sidebar-accent: 20 30% 13%;
|
|
445
|
-
--sidebar-accent-foreground: 35 30% 92%;
|
|
446
|
-
--sidebar-border: 20 30% 13%;
|
|
447
|
-
--sidebar-ring: 25 95% 53%;`
|
|
239
|
+
root: ` --bg: #1a1410;
|
|
240
|
+
--text: #f2ede4;
|
|
241
|
+
--primary: #f97316;
|
|
242
|
+
--accent: #facc15;`,
|
|
243
|
+
dark: ``
|
|
448
244
|
}
|
|
449
245
|
};
|
|
450
246
|
function replaceBlock(css, selector, newVars) {
|
|
@@ -460,7 +256,9 @@ async function applyTheme(options, cssPath, fsModule = nodeFsPromises2) {
|
|
|
460
256
|
}
|
|
461
257
|
const css = await fsModule.readFile(cssPath, "utf-8");
|
|
462
258
|
let updated = replaceBlock(css, ":root", theme.root);
|
|
463
|
-
|
|
259
|
+
if (theme.dark) {
|
|
260
|
+
updated = replaceBlock(updated, ".dark", theme.dark);
|
|
261
|
+
}
|
|
464
262
|
await fsModule.writeFile(cssPath, updated);
|
|
465
263
|
}
|
|
466
264
|
|