From 04735a538deb098931a425d8d3a2c31dda05bc82 Mon Sep 17 00:00:00 2001 From: Astra Date: Thu, 15 May 2025 18:13:36 +0900 Subject: [PATCH] Remove colors.css and new default theme --- src/lib/PostComponent.svelte | 2 +- themes/colors.css | 22 -- themes/default/theme.css | 422 +++++++++++++++++++++++++++++++++++ themes/witchcraft/theme.css | 16 ++ theming.ts | 3 +- 5 files changed, 440 insertions(+), 25 deletions(-) delete mode 100644 themes/colors.css diff --git a/src/lib/PostComponent.svelte b/src/lib/PostComponent.svelte index 6cb6bcd..1cacc28 100644 --- a/src/lib/PostComponent.svelte +++ b/src/lib/PostComponent.svelte @@ -71,7 +71,7 @@ >

{post.authorHandle}@{post.authorHandle} { enforce: 'pre', // Ensure this plugin runs first transform(code, id) { if (id.endsWith('app.css')) { - const colorsCode = Deno.readTextFileSync(Deno.cwd() + '/themes/colors.css'); // Read the theme file and replace the contents of app.css with it // Needs full path to the file const themeCode = Deno.readTextFileSync(Deno.cwd() + '/themes/' + themeFolder + '/theme.css'); @@ -20,7 +19,7 @@ export const themePlugin = (): Plugin => { // and add a comment at the top const themeComment = `/* Generated from ${themeFolder} */\n`; - const themeCodeWithComment = themeComment + colorsCode + themeCode; + const themeCodeWithComment = themeComment + themeCode; // Return the theme code as the new contents of app.css return { code: themeCodeWithComment,