Simplified index.css

Merged colors to single variables
This commit is contained in:
Blboun3 2024-05-31 12:01:01 +02:00
parent 1f06060124
commit d332d2421d
No known key found for this signature in database
2 changed files with 144 additions and 90 deletions

View File

@ -27,7 +27,7 @@ const { Content } = await page.render();
<BlogPost {...page.data} language={lang}> <BlogPost {...page.data} language={lang}>
<article class="prose prose-moi m-[auto] sm:prose-sm md:prose-md xl:prose-lg text-justify"> <article class="prose prose-moi m-[auto] sm:prose-sm md:prose-md xl:prose-lg text-justify">
<div class="text-center"> <div class="text-center">
<h1 class="text-4xl">{page.data.title}</h1> <h1 class="lg:text-4xl text-2xl">{page.data.title}</h1>
<p>{page.data.author} • {formattedDate}</p> <p>{page.data.author} • {formattedDate}</p>
</div> </div>
<Content /> <Content />

View File

@ -8,109 +8,163 @@ Dark Mode: https://www.realtimecolors.com/dashboard?colors=e7e7e9-0f0f0f-5819c5
*/ */
@layer base { @layer base {
:root { :root {
--color-bkg: 0deg, 0%, 94%; /*
--color-bkgNavbar: 0deg, 0%, 50%; Light mode
--color-content: 240deg, 4%, 9%; */
--color-primary: 54deg, 100%, 50%; --light-color-bkg: 0deg, 0%, 94%;
--color-secondary: 237deg, 100%, 93%; --light-color-bkgNavbar: 0deg, 0%, 50%;
--color-accent: 262deg, 73%, 47%; --light-color-content: 240deg, 4%, 9%;
--color-accent-red: 0deg, 84%, 60%; --light-color-primary: 54deg, 100%, 50%;
--border: 214.3 31.8% 91.4%; --light-color-secondary: 237deg, 100%, 93%;
--prose-pink: 336, 93%, 16%; --light-color-accent: 262deg, 73%, 47%;
--light-color-accent-red: 0deg, 84%, 60%;
--light-prose-pink: 336deg, 93%, 16%;
--background: 0 0% 100%; --light-background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%; --light-foreground: 222.2 47.4% 11.2%;
--input: 214.3 31.8% 91.4%; --light-input: 214.3 31.8% 91.4%;
--muted: 210 40% 96.1%; --light-muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%; --light-muted-foreground: 215 17% 34%;
--popover: 0 0% 100%; --light-popover: 0 0% 100%;
--popover-foreground: 222.2 47.4% 11.2%; --light-popover-foreground: 222.2 47.4% 11.2%;
--border: 214.3 31.8% 91.4%; --light-border: 214.3 31.8% 91.4%;
--card: 0 0% 100%; --light-card: 0 0% 100%;
--card-foreground: 222.2 47.4% 11.2%; --light-card-foreground: 222.2 47.4% 11.2%;
--destructive: 0 100% 50%; --light-destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%; --light-destructive-foreground: 210 40% 98%;
--ring: 215 20.2% 65.1%; --light-ring: 215 20.2% 65.1%;
--radius: 0.5rem; --light-radius: 0.5rem;
/*
Dark mode colours
*/
--dark-color-bkg: 0deg, 0%, 6%;
--dark-color-bkgNavbar: 0deg, 0%, 17%;
--dark-color-content: 240deg, 4%, 91%;
--dark-color-primary: 262deg, 77%, 44%;
--dark-color-secondary: 273deg, 100%, 20%;
--dark-color-accent: 54deg, 100%, 50%;
--dark-color-accent-red: 0deg, 84%, 60%;
--dark-prose-pink: 191deg, 51%, 53%;
--dark-background: 224 71% 4%;
--dark-foreground: 213 31% 91%;
--dark-input: 216 34% 17%;
--dark-muted: 0 0% 15%;
--dark-muted-foreground: 215.4 31% 71%;
--dark-popover: 224 71% 4%; /* merge to bkgNavbar */
--dark-popover-foreground: 215 20.2% 65.1%; /* merge to bkg */
--dark-border: 9 20% 21%;
--dark-card: 0 0% 15%;
--dark-card-foreground: 213 31% 91%;
--dark-destructive: 0 63% 31%;
--dark-destructive-foreground: 210 40% 98%;
--dark-ring: 216 34% 17%;
--dark-radius: 0.5rem;
/* DEFAULT to light mode */
--color-bkg: var(--light-color-bkg);
--color-bkgNavbar: var(--light-color-bkgNavbar);
--color-content: var(--light-color-content);
--color-primary: var(--light-color-primary);
--color-secondary: var(--light-color-secondary);
--color-accent: var(--light-color-accent);
--color-accent-red: var(--light-color-accent-red);
--prose-pink: var(--light-prose-pink);
--background: var(--light-background);
--foreground: var(--light-foreground);
--input: var(--light-input);
--muted: var(--light-muted);
--muted-foreground: var(--light-foreground);
--popover: var(--light-popover);
--popover-foreground: var(--light-popover-foreground);
--border: var(--light-border);
--card: var(--light-card);
--card-foreground: var(--light-card-foreground);
--destructive: var(--light-destructive);
--destructive-foreground: var(--light-destructive-foreground);
--ring: var(--light-ring);
--radius: var(--light-radius);
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
--color-bkg: 0deg, 0%, 6%; --color-bkg: var(--dark-color-bkg);
--color-bkgNavbar: 0deg, 0%, 17%; --color-bkgNavbar: var(--dark-color-bkgNavbar);
--color-content: 240deg, 4%, 91%; --color-content: var(--dark-color-content);
--color-primary: 262deg, 77%, 44%; --color-primary: var(--dark-color-primary);
--color-secondary: 273deg, 100%, 20%; --color-secondary: var(--dark-color-secondary);
--color-accent: 54deg, 100%, 50%; --color-accent: var(--dark-color-accent);
--color-accent-red: 0deg, 84%, 60%; --color-accent-red: var(--dark-color-accent-red);
--prose-pink: 191, 51%, 53%; --prose-pink: var(--dark-prose-pink);
--background: 224 71% 4%; --background: var(--dark-background);
--foreground: 213 31% 91%; --foreground: var(--dark-foreground);
--input: 216 34% 17%; --input: var(--dark-input);
--muted: 0 0% 15%; --muted: var(--dark-muted);
--muted-foreground: 215.4 16.3% 56.9%; --muted-foreground: var(--dark-muted-foreground);
--popover: 224 71% 4%; --popover: var(--dark-popover);
--popover-foreground: 215 20.2% 65.1%; --popover-foreground: var(--dark-popover-foreground);
--border: 9 20% 21%; --border: var(--dark-border);
--card: 0 0% 15%; --card: var(--dark-card);
--card-foreground: 213 31% 91%; --card-foreground: var(--dark-card-foreground);
--destructive: 0 63% 31%; --destructive: var(--dark-destructive);
--destructive-foreground: 210 40% 98%; --destructive-foreground: var(--dark-destructive-foreground);
--ring: 216 34% 17%; --ring: var(--dark-ring);
--radius: 0.5rem; --radius: var(--dark-radius);
} }
} }
:root[data-theme="theme_dark"] { :root[data-theme="theme_dark"] {
--color-bkg: 0deg, 0%, 6%; --color-bkg: var(--dark-color-bkg);
--color-bkgNavbar: 0deg, 0%, 17%; --color-bkgNavbar: var(--dark-color-bkgNavbar);
--color-content: 240deg, 4%, 91%; --color-content: var(--dark-color-content);
--color-primary: 262deg, 77%, 44%; --color-primary: var(--dark-color-primary);
--color-secondary: 273deg, 100%, 20%; --color-secondary: var(--dark-color-secondary);
--color-accent: 54deg, 100%, 50%; --color-accent: var(--dark-color-accent);
--color-accent-red: 0deg, 84%, 60%; --color-accent-red: var(--dark-color-accent-red);
--prose-pink: 191, 51%, 53%; --prose-pink: var(--dark-prose-pink);
--background: 224 71% 4%; --background: var(--dark-background);
--foreground: 213 31% 91%; --foreground: var(--dark-foreground);
--input: 216 34% 17%; --input: var(--dark-input);
--muted: 0 0% 15%; --muted: var(--dark-muted);
--muted-foreground: 215.4 16.3% 56.9%; --muted-foreground: var(--dark-muted-foreground);
--popover: 224 71% 4%; --popover: var(--dark-popover);
--popover-foreground: 215 20.2% 65.1%; --popover-foreground: var(--dark-popover-foreground);
--border: 9 20% 21%; --border: var(--dark-border);
--card: 0 0% 15%; --card: var(--dark-card);
--card-foreground: 213 31% 91%; --card-foreground: var(--dark-card-foreground);
--destructive: 0 63% 31%; --destructive: var(--dark-destructive);
--destructive-foreground: 210 40% 98%; --destructive-foreground: var(--dark-destructive-foreground);
--ring: 216 34% 17%; --ring: var(--dark-ring);
--radius: 0.5rem; --radius: var(--dark-radius);
} }
:root[data-theme="theme_light"] { :root[data-theme="theme_light"] {
--color-bkg: 0deg, 0%, 94%; --color-bkg: var(--light-color-bkg);
--color-bkgNavbar: 0deg, 0%, 50%; --color-bkgNavbar: var(--light-color-bkgNavbar);
--color-content: 240deg, 4%, 9%; --color-content: var(--light-color-content);
--color-primary: 54deg, 100%, 50%; --color-primary: var(--light-color-primary);
--color-secondary: 237deg, 100%, 93%; --color-secondary: var(--light-color-secondary);
--color-accent: 262deg, 73%, 47%; --color-accent: var(--light-color-accent);
--color-accent-red: 0deg, 84%, 60%; --color-accent-red: var(--light-color-accent-red);
--prose-pink: 336, 93%, 16%; --prose-pink: var(--light-prose-pink);
--background: 0 0% 100%; --background: var(--light-background);
--foreground: 222.2 47.4% 11.2%; --foreground: var(--light-foreground);
--input: 214.3 31.8% 91.4%; --input: var(--light-input);
--muted: 210 4% 85%; --muted: var(--light-muted);
--muted-foreground: 215.4 16.3% 46.9%; --muted-foreground: var(--light-foreground);
--popover: 0 0% 100%; --popover: var(--light-popover);
--popover-foreground: 222.2 47.4% 11.2%; --popover-foreground: var(--light-popover-foreground);
--border: 214.3 31.8% 91.4%; --border: var(--light-border);
--card: 0 0% 100%; --card: var(--light-card);
--card-foreground: 222.2 47.4% 11.2%; --card-foreground: var(--light-card-foreground);
--destructive: 0 100% 50%; --destructive: var(--light-destructive);
--destructive-foreground: 210 40% 98%; --destructive-foreground: var(--light-destructive-foreground);
--ring: 215 20.2% 65.1%; --ring: var(--light-ring);
--radius: 0.5rem; --radius: var(--light-radius);
} }
} }