Skip to content

Commit 6e1646e

Browse files
committed
[chrome] use firefox themes instead of chrome themes
1 parent 69d9141 commit 6e1646e

File tree

8 files changed

+66
-37
lines changed

8 files changed

+66
-37
lines changed

packages/chrome/src/App.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,26 @@ export function App(props: {}, cx: ComponentContext) {
3333
use(browser.settings.theme).listen(applyTheme);
3434

3535
const theme = {
36-
colors: {
37-
frame: [81, 111, 163],
38-
toolbar: [145, 168, 208],
39-
ntp_background: [131, 156, 200],
40-
tab_text: [27, 43, 70],
41-
bookmark_text: [27, 43, 70],
42-
tab_background_text: [255, 255, 255],
43-
ntp_text: [27, 43, 70],
44-
},
45-
tints: {
46-
buttons: [0.6, 1, 0.2],
47-
frame_incognito: [0.6, 0.5, 0.25],
48-
},
36+
toolbar: "rgb(45, 41, 59)",
37+
toolbar_text: "rgb(236, 191, 189)",
38+
frame: "rgb(30, 30, 40)",
39+
tab_background_text: "rgb(215, 218, 224)",
40+
toolbar_field: "rgb(30, 30, 40)",
41+
toolbar_field_text: "rgb(236, 191, 189)",
42+
tab_line: "rgb(236, 191, 189)",
43+
popup: "rgb(30, 30, 40)",
44+
popup_text: "rgb(236, 191, 189)",
45+
icons: "rgb(198, 170, 232)",
46+
ntp_background: "rgb(21, 18, 28)",
47+
ntp_text: "rgb(164, 185, 239)",
48+
popup_border: "rgb(236, 191, 189)",
49+
toolbar_top_separator: "rgb(30, 30, 40)",
50+
tab_loading: "rgb(236, 191, 189)",
4951
};
5052

5153
cx.mount = () => {
52-
for (const [key, value] of Object.entries(theme.colors)) {
53-
cx.root.style.setProperty(`--${key}`, `rgb(${value.join(",")})`);
54+
for (const [key, value] of Object.entries(theme)) {
55+
cx.root.style.setProperty(`--${key}`, value);
5456
}
5557
};
5658

packages/chrome/src/components/BookmarksStrip.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,17 @@ BookmarksStrip.style = css`
104104
display: flex;
105105
gap: 0.5em;
106106
background: var(--toolbar);
107-
color: var(--bookmark_text);
107+
color: var(--toolbar_text);
108+
--toolbarbutton-hover-background: color-mix(
109+
in srgb,
110+
currentColor 17%,
111+
transparent
112+
);
113+
--toolbarbutton-active-background: color-mix(
114+
in srgb,
115+
currentColor 30%,
116+
transparent
117+
);
108118
}
109119
110120
button {
@@ -115,10 +125,11 @@ BookmarksStrip.style = css`
115125
116126
padding-left: 0.25em;
117127
padding-right: 0.25em;
118-
border-radius: var(--radius);
128+
border-radius: 3px;
129+
color: var(--toolbar_text);
119130
}
120131
button:hover {
121-
background: var(--bg20);
132+
background: var(--toolbarbutton-hover-background);
122133
}
123134
button span {
124135
white-space: nowrap;

packages/chrome/src/components/Omnibar/OmnibarButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ OmnibarButton.style = css`
3232
padding: 0.25em;
3333
3434
font-size: 1.15em;
35-
color: var(--fg2);
35+
color: var(--icons);
3636
border-radius: 0.2em;
37+
38+
opacity: 0.4;
3739
}
3840
:scope.active:hover {
3941
background: var(--bg20);
4042
}
4143
:scope.active {
42-
color: var(--fg2);
44+
opacity: 1;
4345
}
4446
`;

packages/chrome/src/components/Omnibar/Omnibox.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function InactiveBar(props: { subtle: boolean; active: boolean }) {
3838
}
3939
InactiveBar.style = css`
4040
:scope {
41-
background: var(--bg);
41+
background: var(--toolbar_field);
4242
width: 100%;
4343
border: none;
4444
outline: none;
@@ -411,11 +411,11 @@ Omnibox.style = css`
411411
.overflow {
412412
position: absolute;
413413
display: none;
414-
background: var(--bg02);
414+
background: var(--toolbar_field);
415415
width: 100%;
416416
border-radius: 4px;
417417
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
418-
border: 1px solid var(--fg5);
418+
border: 1px solid var(--toolbar_text);
419419
padding-bottom: 0.5em;
420420
}
421421
.overflow .spacer {

packages/chrome/src/components/TabStrip/DragTab.tsx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,12 @@ DragTab.style = css`
141141
--tab-active-border-width: 11px;
142142
--tab-active-border-radius: 10px;
143143
--tab-active-border-radius-neg: -10px;
144+
145+
--tab-selected-textcolor: var(--toolbar_text);
144146
}
145147
146148
.main {
147-
height: 28px;
149+
height: var(--tab-height);
148150
min-width: 0;
149151
width: 100%;
150152
@@ -169,9 +171,9 @@ DragTab.style = css`
169171
overflow: hidden;
170172
white-space: nowrap;
171173
text-overflow: ellipsis;
172-
height: 100%;
173-
vertical-align: center;
174-
line-height: 1.2;
174+
display: flex;
175+
align-items: center;
176+
line-height: var(--tab-height);
175177
}
176178
.main .close > * {
177179
width: 14px;
@@ -190,22 +192,32 @@ DragTab.style = css`
190192
191193
padding: 0;
192194
margin-left: 8px;
195+
position: relative;
193196
}
194-
.close:hover {
195-
background: red;
196-
border-radius: 0.5em;
197+
.close:hover::before {
198+
background: color-mix(in srgb, currentColor 17%, transparent);
199+
position: absolute;
200+
content: "";
201+
width: 21px;
202+
height: 21px;
203+
top: -4px;
204+
left: -4px;
205+
border-radius: 3px;
197206
}
198207
199208
.main:not(.active):hover {
200209
transition: background 250ms;
201-
202-
background: var(--background_tab);
210+
background-color: color-mix(in srgb, currentColor 7%, transparent);
211+
/*background: var(--background_tab);*/
203212
/*color: var(-);*/
204213
}
205214
206215
.main.active {
207216
background: var(--toolbar);
208-
color: var(--tab_text);
217+
color: var(--tab-selected-textcolor);
218+
219+
outline: 1px solid var(--tab-selected-textcolor);
220+
outline-offset: -1px;
209221
}
210222
211223
.belowcontainer {

packages/chrome/src/components/TabStrip/TabStrip.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,10 @@ export function TabStrip(
303303
}
304304
TabStrip.style = css`
305305
:scope {
306+
--tab-padding: 4px;
306307
background: var(--frame);
307-
padding: 6px 12px;
308-
height: calc(28px + 12px);
308+
padding: var(--tab-padding) 12px;
309+
height: calc(var(--tab-height) + calc(var(--tab-padding) * 2));
309310
z-index: 2;
310311
311312
position: relative;

packages/chrome/src/pages/NewTabPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ NewTabPage.style = css`
7777
flex-direction: column;
7878
align-items: center;
7979
font-family: var(--font);
80-
background: var(--bg01);
81-
color: var(--fg);
80+
background: var(--ntp_background);
81+
color: var(--ntp_text);
8282
8383
padding: 5em;
8484
}

packages/chrome/src/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ body.light-mode {
8080

8181
:root {
8282
font-family: "Inter", system-ui, sans-serif;
83+
--tab-height: 33px;
8384
}
8485

8586
* {

0 commit comments

Comments
 (0)