Skip to content

Commit 855ae4f

Browse files
authored
NTP: Improve TabSwitcher hover interactions and visual design (#1853)
1 parent 5e1597c commit 855ae4f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

special-pages/pages/new-tab/app/omnibar/components/TabSwitcher.module.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
border-radius: 99px;
44
box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05) inset;
55
display: grid;
6+
gap: 2px;
67
grid-template-columns: repeat(var(--tab-count), 1fr);
78
overflow: hidden;
89
padding: var(--sp-0_5);
@@ -16,15 +17,24 @@
1617
.tab {
1718
align-items: center;
1819
background: none;
19-
border-radius: 99px;
2020
border: none;
2121
color: var(--ntp-text-normal);
22+
cursor: pointer;
2223
display: flex;
2324
gap: 6px;
2425
height: var(--sp-8);
2526
justify-content: center;
2627
padding: 0 var(--sp-3);
28+
position: relative;
2729
z-index: 1;
30+
31+
&:hover:not([aria-selected="true"])::before {
32+
background: var(--ntp-controls-raised-backdrop);
33+
border-radius: 99px;
34+
content: '';
35+
inset: 0;
36+
position: absolute;
37+
}
2838
}
2939

3040
.tabLabel {
@@ -40,8 +50,8 @@
4050
position: absolute;
4151
top: 2px;
4252
transition: translate 200ms ease;
43-
translate: calc(2px + var(--tab-index) * 100%);
44-
width: calc((100% - 4px) / var(--tab-count));
53+
translate: calc(2px + var(--tab-index) * (100% + 2px));
54+
width: calc((100% - 4px - (var(--tab-count) - 1) * 2px) / var(--tab-count));
4555
will-change: translate;
4656

4757
[data-theme="dark"] & {

0 commit comments

Comments
 (0)