Skip to content

Commit 7deb986

Browse files
committed
Fix up CSS and dark mode
1 parent c945f18 commit 7deb986

4 files changed

Lines changed: 82 additions & 40 deletions

File tree

src/app.css

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,64 @@
11
@import 'tailwindcss';
2+
3+
/* =============================================================================
4+
Design tokens - CSS Custom Properties
5+
6+
These variables serve as the single source of truth for all colors, spacing,
7+
and typography. They can be used in both scoped CSS and Tailwind classes.
8+
9+
Future: Can be modified at runtime for user theme customization.
10+
============================================================================= */
11+
12+
:root {
13+
/* === Backgrounds === */
14+
--color-bg-primary: #ffffff;
15+
--color-bg-secondary: #f5f5f5;
16+
17+
/* === Borders === */
18+
--color-border-primary: #ccc;
19+
20+
/* === Text === */
21+
--color-text-primary: #000000;
22+
--color-text-secondary: #666666;
23+
--color-text-muted: #999999;
24+
25+
/* === Interactive States === */
26+
--color-hover-bg: rgba(0, 120, 215, 0.1);
27+
28+
/* === Semantic Colors === */
29+
--color-error: #d32f2f;
30+
31+
/* === Spacing === */
32+
--spacing-xs: 0.25rem;
33+
--spacing-sm: 0.5rem;
34+
--spacing-md: 1rem;
35+
36+
/* === Typography === */
37+
--font-mono: 'SF Mono', Monaco, monospace;
38+
--font-size-xs: 12px;
39+
--font-size-sm: 13px;
40+
--font-size-base: 14px;
41+
}
42+
43+
/* Dark Mode - automatically applied when user's system prefers dark mode */
44+
@media (prefers-color-scheme: dark) {
45+
:root {
46+
/* === Backgrounds === */
47+
--color-bg-primary: #1e1e1e;
48+
--color-bg-secondary: #2a2a2a;
49+
50+
/* === Borders === */
51+
--color-border-primary: #444444;
52+
53+
/* === Text === */
54+
--color-text-primary: #ffffff;
55+
--color-text-secondary: #aaaaaa;
56+
--color-text-muted: #808080;
57+
58+
/* === Interactive States === */
59+
--color-hover-bg: rgba(100, 180, 255, 0.15);
60+
61+
/* === Semantic Colors === */
62+
--color-error: #f44336;
63+
}
64+
}

src/lib/file-explorer/FileList.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,25 @@
2727
margin: 0;
2828
padding: 0;
2929
overflow-y: auto;
30-
font-family: 'SF Mono', Monaco, monospace;
31-
font-size: 13px;
30+
font-family: var(--font-mono) monospace;
31+
font-size: var(--font-size-sm);
3232
}
3333
3434
.file-entry {
35-
padding: 0.25rem 0.5rem;
35+
padding: var(--spacing-xs) var(--spacing-sm);
3636
cursor: pointer;
3737
display: flex;
3838
align-items: center;
39-
gap: 0.5rem;
39+
gap: var(--spacing-sm);
4040
user-select: none;
4141
}
4242
4343
.file-entry:hover {
44-
background-color: rgba(0, 120, 215, 0.1);
44+
background-color: var(--color-hover-bg);
4545
}
4646
4747
.icon {
48-
font-size: 14px;
48+
font-size: var(--font-size-base);
4949
flex-shrink: 0;
5050
}
5151

src/lib/file-explorer/FilePane.svelte

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,22 @@
6060
display: flex;
6161
flex-direction: column;
6262
overflow: hidden;
63-
border: 1px solid #ccc;
63+
border: 1px solid var(--color-border-primary);
6464
}
6565
6666
.header {
67-
padding: 0.5rem;
68-
background-color: #f5f5f5;
69-
border-bottom: 1px solid #ccc;
70-
font-size: 12px;
67+
padding: var(--spacing-sm);
68+
background-color: var(--color-bg-secondary);
69+
border-bottom: 1px solid var(--color-border-primary);
70+
font-size: var(--font-size-xs);
7171
overflow: hidden;
7272
text-overflow: ellipsis;
7373
white-space: nowrap;
7474
}
7575
7676
.path {
77-
font-family: 'SF Mono', Monaco, monospace;
78-
color: #666;
77+
font-family: var(--font-mono) monospace;
78+
color: var(--color-text-secondary);
7979
}
8080
8181
.content {
@@ -91,36 +91,13 @@
9191
align-items: center;
9292
justify-content: center;
9393
height: 100%;
94-
color: #666;
95-
font-size: 14px;
94+
color: var(--color-text-secondary);
95+
font-size: var(--font-size-base);
9696
}
9797
9898
.error-message {
99-
color: #d32f2f;
99+
color: var(--color-error);
100100
text-align: center;
101-
padding: 1rem;
102-
}
103-
104-
@media (prefers-color-scheme: dark) {
105-
.file-pane {
106-
border-color: #444;
107-
}
108-
109-
.header {
110-
background-color: #2a2a2a;
111-
border-bottom-color: #444;
112-
}
113-
114-
.path {
115-
color: #aaa;
116-
}
117-
118-
.message {
119-
color: #aaa;
120-
}
121-
122-
.error-message {
123-
color: #f44336;
124-
}
101+
padding: var(--spacing-md);
125102
}
126103
</style>

src/routes/+page.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
width: 100%;
1212
height: 100%;
1313
overflow: hidden;
14+
background-color: var(--color-bg-primary);
15+
color: var(--color-text-primary);
1416
}
1517
1618
:global(#app) {

0 commit comments

Comments
 (0)