Skip to content

Commit 002aed4

Browse files
committed
feat: [UI] Modern Ctrl Tab Preview
Signed-off-by: Hugo Lee <104642670+Gholts@users.noreply.github.com>
1 parent c4f98b0 commit 002aed4

1 file changed

Lines changed: 94 additions & 3 deletions

File tree

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,103 @@
11
diff --git a/browser/themes/shared/tabbrowser/ctrlTab.css b/browser/themes/shared/tabbrowser/ctrlTab.css
2-
index ffda4922c675f6159c825334cba9d49658d316ba..7b3d4d2b5c6d732a1d0074e05cc48131fe57c630 100644
2+
index ffda4922c675f6159c825334cba9d49658d316ba..95f7eb1da53f1986e7c3da41a0f10e03f80c4812 100644
33
--- a/browser/themes/shared/tabbrowser/ctrlTab.css
44
+++ b/browser/themes/shared/tabbrowser/ctrlTab.css
5-
@@ -11,6 +11,7 @@
6-
--panel-border-color: transparent;
5+
@@ -6,16 +6,23 @@
6+
7+
#ctrlTab-panel {
8+
appearance: none;
9+
- --panel-background: hsla(0, 0%, 40%, 0.85);
10+
- --panel-color: white;
11+
- --panel-border-color: transparent;
12+
+ --panel-background: light-dark(rgba(244,244,244,1), rgba(24,24,24,1));
13+
+ --panel-color: white; /* Note: looking for better solution */
14+
+ --panel-border-color: light-dark(rgba(220,220,220,1), rgba(78,78,78,1));
15+
+ --panel-border-radius: 19px;
716
--panel-padding: 20px 10px 10px;
817
-moz-window-shadow: none;
918
+ --panel-shadow-margin: 0;
1019
@media not (-moz-platform: macos) {
1120
font-weight: var(--font-weight-bold);
1221
}
22+
}
23+
24+
+/* Preventing corners exist after border-radius is set */
25+
+panel#ctrlTab-panel {
26+
+ border-radius: var(--panel-border-radius);
27+
+}
28+
+
29+
.ctrlTab-preview,
30+
#ctrlTab-showAll {
31+
appearance: none;
32+
@@ -35,27 +42,32 @@
33+
}
34+
35+
.ctrlTab-favicon-container {
36+
- position: relative;
37+
- justify-content: flex-end;
38+
+ position: absolute;
39+
+ top: 8px;
40+
+ left: 8px;
41+
+ z-index: 10;
42+
+ background-color: light-dark(rgba(234,234,234,1), rgba(34,34,34,1));
43+
+ border-radius: calc(var(--border-radius-medium) + 2px);
44+
+ border: 1px solid light-dark(color-mix(in srgb, var(--zen-colors-hover-bg), white 84%), color-mix(in srgb, var(--zen-colors-hover-bg), white 20%));
45+
}
46+
47+
.ctrlTab-favicon[src] {
48+
- width: 42px;
49+
- height: 42px;
50+
- margin-top: -44px;
51+
- margin-bottom: 2px;
52+
- margin-inline-end: -6px;
53+
- padding: 5px;
54+
- background-color: #f9f9fa;
55+
- border-radius: var(--border-radius-small);
56+
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
57+
+ box-sizing: border-box;
58+
+ width: 30px;
59+
+ height: 30px;
60+
+ padding: 4px;
61+
+ border-radius: calc(var(--border-radius-medium) + 2px);
62+
+ box-shadow: 0px 0px 25px 1px light-dark(rgba(0,0,0,0.2), rgba(0,0,0,0.3));
63+
}
64+
65+
.ctrlTab-canvas {
66+
+ border-radius: 6px;
67+
+ overflow: hidden;
68+
color-scheme: light;
69+
background-color: Canvas;
70+
color: CanvasText;
71+
- box-shadow: 1px 1px 2px hsl(0, 0%, 12%);
72+
+ box-shadow: 0px 0px 20px 2px light-dark(rgba(0,0,0,0.5), rgba(0,0,0,0.7));
73+
+ margin: 10px;
74+
margin-bottom: 8px;
75+
min-width: 0;
76+
77+
@@ -82,20 +94,22 @@
78+
}
79+
80+
.ctrlTab-preview-inner {
81+
+ position: relative;
82+
margin-top: -10px;
83+
min-width: 0;
84+
}
85+
86+
#ctrlTab-showAll {
87+
- background-color: rgba(255, 255, 255, 0.2);
88+
+ background-color: rgba(255,255,255,0.2);
89+
margin-top: 0.5em;
90+
}
91+
92+
.ctrlTab-preview:focus > .ctrlTab-preview-inner,
93+
#ctrlTab-showAll:focus {
94+
- background-color: rgba(0, 0, 0, 0.75);
95+
- text-shadow: none;
96+
- border-color: #45a1ff;
97+
+ border-radius: 11px;
98+
+ border-color: var(--panel-background);
99+
+ box-shadow: 0px 0px 2px 1px light-dark(color-mix(in srgb, var(--zen-colors-hover-bg), white 55%), color-mix(in srgb, var(--zen-colors-hover-bg), white 30%)) inset;
100+
+ background-color: light-dark(color-mix(in srgb, var(--zen-colors-hover-bg), white 45%), color-mix(in srgb, var(--zen-colors-hover-bg), white 25%));
101+
}
102+
103+
.ctrlTab-label {

0 commit comments

Comments
 (0)