Skip to content

Commit 08caa1d

Browse files
committed
feat: enhance CSS variables and theming for improved dark mode support
1 parent d01ec4a commit 08caa1d

File tree

2 files changed

+166
-2
lines changed

2 files changed

+166
-2
lines changed

src/client/styles/main.css

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,166 @@
11
@import "tailwindcss";
2+
3+
@custom-variant dark (&:is(.dark *));
4+
5+
@property --tw-gradient-from {
6+
syntax: "<color>";
7+
inherits: false;
8+
initial-value: #0000;
9+
}
10+
11+
@theme inline {
12+
--font-poppins: "Poppins", sans-serif;
13+
--font-inter: "Inter",sans-serif;
14+
--font-roboto: "Roboto", sans-serif;
15+
--font-kantumruy: "Kantumruy Pro", sans-serif;
16+
--font-sans: "Inter", sans-serif;
17+
--font-open-sans: "Open Sans", sans-serif;
18+
--animate-orbit: orbit calc(var(--duration) * 1s) linear infinite;
19+
20+
--color-background: hsl(var(--background));
21+
--color-foreground: hsl(var(--foreground));
22+
--color-card: hsl(var(--card));
23+
--color-card-foreground: hsl(var(--card-foreground));
24+
--color-popover: hsl(var(--popover));
25+
--color-popover-foreground: hsl(var(--popover-foreground));
26+
--color-primary: hsl(var(--primary));
27+
--color-primary-foreground: hsl(var(--primary-foreground));
28+
--color-secondary: hsl(var(--secondary));
29+
--color-secondary-foreground: hsl(var(--secondary-foreground));
30+
--color-muted: hsl(var(--muted));
31+
--color-muted-foreground: hsl(var(--muted-foreground));
32+
--color-accent: hsl(var(--accent));
33+
--color-accent-foreground: hsl(var(--accent-foreground));
34+
--color-destructive: hsl(var(--destructive));
35+
--color-destructive-foreground: hsl(var(--destructive-foreground));
36+
--color-border: hsl(var(--border));
37+
--color-input: hsl(var(--input));
38+
--color-ring: hsl(var(--primary));
39+
--font-default: var(--font-default);
40+
--border-radius: var(--radius);
41+
42+
--breakpoint-xs: 30rem;
43+
--breakpoint-xxs: 20rem;
44+
45+
--animate-meteor: meteor 5s linear infinite;
46+
47+
--color-sidebar-ring: var(--sidebar-ring);
48+
--color-sidebar-border: var(--sidebar-border);
49+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
50+
--color-sidebar-accent: var(--sidebar-accent);
51+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
52+
--color-sidebar-primary: var(--sidebar-primary);
53+
--color-sidebar-foreground: var(--sidebar-foreground);
54+
--color-sidebar: var(--sidebar);
55+
56+
--shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
57+
58+
--animate-ripple: ripple var(--duration, 2s) ease calc(var(--i, 0) * 0.2s) infinite;
59+
60+
61+
@keyframes ripple {
62+
63+
0%,
64+
100% {
65+
transform: translate(-50%, -50%) scale(1);
66+
}
67+
68+
50% {
69+
transform: translate(-50%, -50%) scale(0.9);
70+
}
71+
}
72+
}
73+
74+
@layer base {
75+
:root {
76+
--background: 210 40% 98%;
77+
--foreground: 240 10% 11%;
78+
--card: 0 0% 100%;
79+
--card-foreground: 240 10% 3.9%;
80+
--popover: 0 0% 100%;
81+
--popover-foreground: 240 10% 3.9%;
82+
--primary: 163 96% 25%;
83+
--primary-foreground: 0 0% 98%;
84+
--secondary: 240 4.8% 95.9%;
85+
--secondary-foreground: 240 5.9% 10%;
86+
--muted: 240 4.8% 95.9%;
87+
--muted-foreground: 240 3.8% 46.1%;
88+
--accent: 240 4.8% 95.9%;
89+
--accent-foreground: 240 5.9% 10%;
90+
--destructive: 0 84.2% 60.2%;
91+
--destructive-foreground: 0 0% 98%;
92+
--border: 240 5.9% 90%;
93+
--input: 240 5.9% 90%;
94+
--ring: 240 10% 3.9%;
95+
--radius: 0.5rem;
96+
97+
--sidebar: hsl(0 0% 98%);
98+
--sidebar-foreground: hsl(240 5.3% 26.1%);
99+
--sidebar-primary: hsl(240 5.9% 10%);
100+
--sidebar-primary-foreground: hsl(0 0% 98%);
101+
--sidebar-accent: hsl(240 4.8% 95.9%);
102+
--sidebar-accent-foreground: hsl(240 5.9% 10%);
103+
--sidebar-border: hsl(220 13% 91%);
104+
--sidebar-ring: hsl(217.2 91.2% 59.8%);
105+
}
106+
107+
.dark {
108+
--background: 240 10% 11%;
109+
--foreground: 0 0% 98%;
110+
--card: 240 10% 3.9%;
111+
--card-foreground: 0 0% 98%;
112+
--popover: 240 10% 3.9%;
113+
--popover-foreground: 0 0% 98%;
114+
--primary: 163 96% 25%;
115+
--primary-foreground: 0 0% 98%;
116+
--secondary: 240 3.7% 15.9%;
117+
--secondary-foreground: 0 0% 98%;
118+
--muted: 240 3.7% 15.9%;
119+
--muted-foreground: 240 5% 64.9%;
120+
--accent: 240 12.71% 6.42%;
121+
--accent-foreground: 0 0% 98%;
122+
--destructive: 0 62.8% 30.6%;
123+
--destructive-foreground: 0 0% 98%;
124+
--border: 240 3.7% 15.9%;
125+
--input: 240 3.7% 15.9%;
126+
--ring: 240 4.9% 83.9%;
127+
128+
--sidebar: hsl(240 5.9% 10%);
129+
--sidebar-foreground: hsl(240 4.8% 95.9%);
130+
--sidebar-primary: hsl(224.3 76.3% 48%);
131+
--sidebar-primary-foreground: hsl(0 0% 100%);
132+
--sidebar-accent: hsl(240 3.7% 15.9%);
133+
--sidebar-accent-foreground: hsl(240 4.8% 95.9%);
134+
--sidebar-border: hsl(240 3.7% 15.9%);
135+
--sidebar-ring: hsl(217.2 91.2% 59.8%);
136+
}
137+
138+
*,
139+
::after,
140+
::before,
141+
::backdrop,
142+
::file-selector-button {
143+
border-color: var(--color-border, currentColor);
144+
}
145+
146+
* {
147+
@apply border-border outline-ring/50 font-sans;
148+
}
149+
150+
body {
151+
@apply bg-background text-foreground font-default;
152+
}
153+
154+
*::-webkit-scrollbar {
155+
@apply w-2 bg-transparent;
156+
}
157+
158+
*::-webkit-scrollbar-thumb {
159+
@apply bg-border rounded;
160+
}
161+
162+
*::-webkit-scrollbar-track {
163+
@apply bg-transparent;
164+
}
165+
166+
}

src/client/views/layouts/main.ejs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
<title><%= typeof title !== 'undefined' ? title : 'CloudBox Dashboard' %></title>
77
<link rel="stylesheet" href="/styles/output.css">
88
<style>
9-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
10-
body { font-family: 'Inter', sans-serif; }
9+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Kantumruy+Pro:ital,wght@0,100..700;1,100..700&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Kantumruy+Pro:ital,wght@0,100..700;1,100..700&display=swap');
1110
</style>
1211
</head>
1312
<body class="text-slate-700">

0 commit comments

Comments
 (0)