Added a separate file for color variables

This commit is contained in:
Ariadna 2025-05-15 02:24:42 -04:00
parent cebae8c7ae
commit ec73af5618
Signed by: ari
SSH key fingerprint: SHA256:j4xpQafvRcIH4rwZqM5aREIogWsCjyYohia7vH0+uZY
4 changed files with 14 additions and 13 deletions

View file

@ -1,3 +1,4 @@
@import url('./themes/colors.css');
body { body {
background-color: red; background-color: red;
} }

11
src/themes/colors.css Normal file
View file

@ -0,0 +1,11 @@
:root {
--link-color: #646cff;
--link-hover-color: #535bf2;
--background-color: #12082b;
--header-background-color: #1f1145;
--content-background-color: #0d0620;
--text-color: white;
--border-color: #8054f0;
--indicator-inactive-color: #4a4a4a;
--indicator-active-color: #8054f0;
}

View file

@ -3,18 +3,6 @@
src: url(https://witchcraft.systems/ProggyCleanNerdFont-Regular.ttf); src: url(https://witchcraft.systems/ProggyCleanNerdFont-Regular.ttf);
} }
:root {
--link-color: #646cff;
--link-hover-color: #535bf2;
--background-color: #12082b;
--header-background-color: #1f1145;
--content-background-color: #0d0620;
--text-color: white;
--border-color: #8054f0;
--indicator-inactive-color: #4a4a4a;
--indicator-active-color: #8054f0;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0px; width: 0px;
background: transparent; background: transparent;

View file

@ -11,6 +11,7 @@ export const themePlugin = (): Plugin => {
name: 'theme-generator', name: 'theme-generator',
transform(code, id) { transform(code, id) {
if (id.endsWith('app.css')) { if (id.endsWith('app.css')) {
const colorsCode = Deno.readTextFileSync(Deno.cwd() + '/src/themes/colors.css');
// Read the theme file and replace the contents of app.css with it // Read the theme file and replace the contents of app.css with it
// Needs full path to the file // Needs full path to the file
const themeCode = Deno.readTextFileSync(Deno.cwd() + '/src/themes/' + themeFile); const themeCode = Deno.readTextFileSync(Deno.cwd() + '/src/themes/' + themeFile);
@ -18,7 +19,7 @@ export const themePlugin = (): Plugin => {
// and add a comment at the top // and add a comment at the top
const themeComment = `/* Generated from ${themeFile} */\n`; const themeComment = `/* Generated from ${themeFile} */\n`;
const themeCodeWithComment = themeComment + themeCode; const themeCodeWithComment = themeComment + colorsCode + themeCode;
// Return the theme code as the new contents of app.css // Return the theme code as the new contents of app.css
return { return {
code: themeCodeWithComment, code: themeCodeWithComment,