Skip to content

Commit 7424631

Browse files
committed
feat: implement light theme foundation
Add CSS variables for light mode color palette and refactor components to use theme variables instead of explicit color values. This groundwork prepares the codebase for theme switching. Resolves quoid#392
1 parent 652e4c6 commit 7424631

8 files changed

Lines changed: 66 additions & 24 deletions

File tree

etc/uilayout.sketch

-81.5 KB
Binary file not shown.

src/ext/action-popup/Components/Views/InstallView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
}
159159
160160
button {
161-
background-color: #ffffffa6; /* -text-color-secondary */
161+
background-color: var(--text-color-secondary);
162162
border-radius: var(--border-radius);
163163
color: var(--color-bg-primary);
164164
flex-grow: 1;

src/ext/extension-page/Components/Editor/Editor.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
}
312312
313313
.editor__footer {
314-
background: rgba(50 54 57 / 0.65);
314+
background: var(--editor-blurred-background);
315315
border-radius: var(--border-radius);
316316
bottom: 0.25rem;
317317
padding: 0.5rem 1rem;

src/ext/extension-page/Components/Sidebar/Sidebar.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
.sidebar__count {
275275
backdrop-filter: blur(3px);
276276
-webkit-backdrop-filter: blur(3px);
277-
background: rgba(47 51 55 / 0.65);
277+
background: var(--editor-blurred-background);
278278
border-radius: var(--border-radius);
279279
bottom: 0.25rem;
280280
color: var(--text-color-secondary);

src/ext/extension-page/Components/Sidebar/SidebarItem.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
6969
.item.active {
7070
background-color: var(--color-script-highlighted);
71-
background-color: #364049;
7271
cursor: default;
7372
}
7473

src/ext/shared/Components/Toggle.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838
3939
span {
40-
background-color: var(--color-black);
40+
background-color: var(--text-color-disabled);
4141
border-radius: 0.625em;
4242
display: block;
4343
height: 100%;

src/ext/shared/img/logo-light.svg

Lines changed: 1 addition & 0 deletions
Loading

src/shared/variables.css

Lines changed: 61 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,48 @@
1+
/* Base styles */
12
:root {
3+
/* Layout variables */
24
--border-radius: 0.188rem;
3-
--box-shadow: 0 0.5rem 1rem 0 rgb(0 0 0 / 0.25);
4-
--color-bg-primary: #323639;
5-
--color-bg-secondary: #2f3337;
6-
--color-script-highlighted: #364049; /* rgba(116, 178, 235, 0.1); */
7-
--color-black: #1d2023;
8-
--color-blue: #74b1eb;
9-
--color-green: #60f36c;
10-
--color-grey: rgb(255 255 255 / 0.15);
11-
--color-red: #ff453a;
12-
--color-yellow: #e4f360;
13-
--letter-spacing-large: -0.031rem;
5+
--font-family: -apple-system, "Helvetica Neue", "Helvetica", sans-serif;
146
--letter-spacing-default: -0.029rem;
7+
--letter-spacing-large: -0.031rem;
158
--letter-spacing-medium: -0.018rem;
169
--letter-spacing-small: -0.008rem;
1710
--opacity-disabled: 0.3;
18-
--text-color-primary: rgb(255 255 255);
19-
--text-color-secondary: rgb(255 255 255 / 0.65);
20-
--text-color-disabled: rgb(255 255 255 / 0.4);
21-
--font-family: -apple-system, "Helvetica Neue", "Helvetica", sans-serif;
2211
--text-default: 1rem/1.5rem var(--font-family);
2312
--text-large: 1.25rem/1.5rem var(--font-family);
2413
--text-medium: 0.875rem/1.313rem var(--font-family);
2514
--text-small: 0.719rem/1rem var(--font-family);
2615

27-
/* editor variables */
16+
/* Editor layout variables */
2817
--editor-font: monaco, monospace;
2918
--editor-font-size: 14px;
3019
--editor-line-height: 24px;
31-
--editor-invisible: rgb(255 255 255 / 0.15);
3220
--editor-active-line: var(--color-bg-secondary);
21+
--editor-error: var(--color-red);
22+
--editor-non-matching-bracket: var(--editor-error);
3323
--editor-selected-bg: rgb(116 178 235 / 0.35);
3424
--editor-matched-highlight: rgb(116 178 235 / 0.2);
3525
--editor-search-highlight: rgb(255 166 0 / 0.3);
26+
}
27+
28+
/* Dark theme (default) */
29+
body {
30+
--color-bg-primary: #323639;
31+
--color-bg-secondary: #2f3337;
32+
--color-script-highlighted: #364049;
33+
--color-black: #1d2023;
34+
--color-blue: #74b1eb;
35+
--color-green: #60f36c;
36+
--color-grey: rgb(255 255 255 / 0.15);
37+
--color-red: #ff453a;
38+
--color-yellow: #e4f360;
39+
--text-color-primary: rgb(255 255 255);
40+
--text-color-secondary: rgb(255 255 255 / 0.65);
41+
--text-color-disabled: rgb(255 255 255 / 0.4);
42+
--box-shadow: 0 0.5rem 1rem 0 rgb(0 0 0 / 0.25);
43+
44+
/* Editor dark theme colors */
45+
--editor-invisible: rgb(255 255 255 / 0.15);
3646
--editor-number: #77e26a;
3747
--editor-comment: rgb(255 255 255 / 0.35);
3848
--editor-def: #efc371;
@@ -43,9 +53,41 @@
4353
--editor-property: #e86c8a;
4454
--editor-string: #f5eea2;
4555
--editor-string-2: #cdabff;
46-
--editor-error: var(--color-red);
4756
--editor-cursor: #e3e7eb;
4857
--editor-matching-bracket-color: #fff;
4958
--editor-matching-bracket-border: var(--editor-number);
50-
--editor-non-matching-bracket: var(--editor-error);
59+
--editor-blurred-background: rgba(50 54 57 / 0.65);
60+
}
61+
62+
/* Light theme */
63+
body.light-theme {
64+
--color-bg-primary: #fafafa;
65+
--color-bg-secondary: #f1f1f1;
66+
--color-script-highlighted: #e2ebf3;
67+
--color-black: #fff;
68+
--color-blue: #317eff;
69+
--color-green: #2bb239;
70+
--color-grey: rgb(51 51 51 / 0.15);
71+
--color-red: #ff453a;
72+
--color-yellow: #b8722c;
73+
--text-color-primary: rgb(51 51 51);
74+
--text-color-secondary: rgb(51 51 51 / 0.65);
75+
--text-color-disabled: rgb(51 51 51 / 0.35);
76+
77+
/* Editor light theme colors */
78+
--editor-invisible: rgb(51 51 51 / 0.15);
79+
--editor-number: var(--color-green);
80+
--editor-comment: var(--text-color-disabled);
81+
--editor-def: #b86d17;
82+
--editor-default: #777;
83+
--editor-keyword: #3a68ff;
84+
--editor-atom: #00adad;
85+
--editor-operator: #8c99a7;
86+
--editor-property: #ff453a;
87+
--editor-string: var(--editor-atom);
88+
--editor-string-2: #a34fe6;
89+
--editor-cursor: #7e7e7f;
90+
--editor-matching-bracket-color: var(--text-color-primary);
91+
--editor-matching-bracket-border: #ff00ea;
92+
--editor-blurred-background: rgba(255 255 255 / 0.65); /* eeeeeea6 */
5193
}

0 commit comments

Comments
 (0)