Skip to content

Commit 979caac

Browse files
authored
NTP: Adjust omnibar colours to match native apps and Figma (#1863)
* Use design system border radius in omnibar container * Adjust tab switcher hover background color * Update AI chat button styles with new theme variables * Use theme variables from Figma to improve color consistency * Add backdrop blur to omnibar components
1 parent 621556e commit 979caac

File tree

6 files changed

+61
-34
lines changed

6 files changed

+61
-34
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
background: none;
1111
border: none;
1212
box-sizing: content-box;
13-
color: var(--ntp-text-normal);
13+
color: var(--ntp-text-primary);
1414
max-height: 10lh;
1515
padding: 11px 15px 0;
1616
resize: none;
@@ -20,7 +20,7 @@
2020
}
2121

2222
&::placeholder {
23-
color: var(--ntp-text-muted);
23+
color: var(--ntp-text-tertiary);
2424
}
2525

2626
[data-platform="windows"] &::selection {
@@ -33,7 +33,7 @@
3333
}
3434

3535
.hasScroll & {
36-
border-bottom: 1px solid var(--ntp-surface-border-color);
36+
border-bottom: 1px solid var(--ntp-decoration-tertiary);
3737
padding-bottom: 11px;
3838
}
3939
}
@@ -50,10 +50,10 @@
5050

5151
.submitButton {
5252
align-items: center;
53-
background: var(--color-blue-50);
53+
background: var(--ntp-accent-primary);
5454
border-radius: 100%;
5555
border: none;
56-
color: var(--color-white);
56+
color: var(--ntp-accent-content-primary);
5757
cursor: pointer;
5858
display: flex;
5959
height: var(--sp-7);
@@ -64,8 +64,9 @@
6464

6565
&[disabled] {
6666
background: none;
67-
color: rgba(0, 0, 0, 0.3);
67+
color: var(--ntp-icons-primary);
6868
cursor: default;
69+
opacity: 0.3;
6970
}
7071

7172
&:focus-visible {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
}
55

66
.inner {
7+
backdrop-filter: blur(48px);
78
background: var(--ntp-surface-tertiary);
8-
border-radius: 15px;
9+
border-radius: var(--border-radius-lg);
910
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1), 0px 4px 8px 0px rgba(0, 0, 0, 0.08);
1011
overflow: hidden;
1112
position: relative;
@@ -17,7 +18,7 @@
1718

1819
&:not(:has([role="listbox"])).focusRing,
1920
&:not(:has([role="listbox"])):focus-within:not(.noFocusRing) {
20-
box-shadow: 0 0 0 1px var(--ntp-surface-tertiary), 0 0 0 3px var(--ntp-color-primary), 0 0 0 5px rgba(57, 105, 239, 0.2);
21+
box-shadow: 0 0 0 1px var(--ntp-surface-tertiary), 0 0 0 3px var(--ntp-accent-primary), 0 0 0 5px var(--ntp-accent-glow);
2122
}
2223

2324
&:has([role="listbox"]) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
.input {
1313
background: none;
1414
border: none;
15-
color: var(--ntp-text-normal);
15+
color: var(--ntp-text-primary);
1616
font: var(--input-font);
1717
height: var(--sp-8);
1818
left: 7px;
@@ -24,7 +24,7 @@
2424
right: 7px;
2525

2626
&::placeholder {
27-
color: var(--ntp-text-muted);
27+
color: var(--ntp-text-tertiary);
2828
}
2929

3030
[data-platform="windows"] &::selection {
@@ -45,7 +45,7 @@
4545
}
4646

4747
.suffix {
48-
color: var(--ntp-color-primary);
48+
color: var(--ntp-accent-primary);
4949
flex: none;
5050
font: var(--input-font);
5151
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
background: none;
1111
border-radius: 4px;
1212
border: none;
13-
color: var(--ntp-text-normal);
13+
color: var(--ntp-text-primary);
1414
cursor: pointer;
1515
display: flex;
1616
height: var(--sp-8);
@@ -24,23 +24,23 @@
2424

2525
&[aria-selected="true"],
2626
&:active {
27-
color: var(--color-white);
27+
color: var(--ntp-accent-content-primary);
2828

2929
.suffix {
30-
color: var(--color-white);
30+
color: var(--ntp-accent-content-primary);
3131
}
3232

3333
.badge {
34-
background: var(--color-white-at-30);
34+
background: var(--color-white-at-30); /* @fixme: Should use a --ntp theme variable for this. This pill design differs from Figma, though */
3535
}
3636
}
3737

3838
&[aria-selected="true"] {
39-
background: var(--ddg-color-primary);
39+
background: var(--ntp-accent-primary);
4040
}
4141

4242
&:active {
43-
background: var(--color-blue-60);
43+
background: var(--ntp-accent-secondary);
4444
}
4545
}
4646

@@ -53,7 +53,7 @@
5353
}
5454

5555
.suffix {
56-
color: var(--ntp-text-muted);
56+
color: var(--ntp-text-tertiary);
5757
flex: initial;
5858
font-size: 12px;
5959
overflow: hidden;

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
.tabSwitcher {
2+
backdrop-filter: blur(48px);
23
background: var(--ntp-controls-raised-backdrop);
34
border-radius: 99px;
4-
box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05) inset;
5+
box-shadow: 0px 1px 0px 0px var(--ntp-shadow-primary) inset;
56
display: grid;
6-
gap: 2px;
7+
gap: var(--sp-0_5);
78
grid-template-columns: repeat(var(--tab-count), 1fr);
89
overflow: hidden;
910
padding: var(--sp-0_5);
1011
position: relative;
11-
12-
[data-theme="dark"] & {
13-
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.16) inset;
14-
}
1512
}
1613

1714
.tab {
1815
align-items: center;
1916
background: none;
2017
border: none;
21-
color: var(--ntp-text-normal);
18+
color: var(--ntp-text-primary);
2219
cursor: pointer;
2320
display: flex;
2421
gap: 6px;
@@ -30,7 +27,7 @@
3027
z-index: 1;
3128

3229
&:hover:not([aria-selected="true"])::before {
33-
background: var(--ntp-controls-raised-backdrop);
30+
background: var(--ntp-controls-fill-primary);
3431
border-radius: 99px;
3532
content: '';
3633
inset: 0;
@@ -45,7 +42,7 @@
4542
.blob {
4643
background-color: var(--ntp-controls-raised-fill-primary);
4744
border-radius: 18px;
48-
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.48);
45+
box-shadow: 0 4px 4px var(--ntp-shadow-secondary), 0 1px 2px var(--ntp-shadow-secondary), inset 0 1px 0 rgba(255, 255, 255, 0.48);
4946
height: var(--sp-8);
5047
left: 0;
5148
position: absolute;
@@ -57,7 +54,7 @@
5754
z-index: 0;
5855

5956
[data-theme="dark"] & {
60-
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.24), 0 1px 2px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
57+
box-shadow: 0 4px 4px var(--ntp-shadow-secondary), 0 1px 2px var(--ntp-shadow-secondary), inset 0 1px 0 rgba(255, 255, 255, 0.06);
6158
}
6259

6360
@media (prefers-reduced-motion: reduce) {

special-pages/pages/new-tab/app/styles/ntp-theme.css

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,25 @@ body {
5555
--focus-ring: 0px 0px 0px 1px var(--color-white), 0px 0px 0px 3px var(--ntp-focus-outline-color);
5656
--focus-ring-thin: 0px 0px 0px 1px var(--ntp-focus-outline-color), 0px 0px 0px 1px var(--color-white);
5757
--focus-ring-primary: 0px 0px 0px 1px var(--color-white), 0px 0px 0px 3px var(--ntp-color-primary);
58-
--ntp-surface-tertiary: var(--color-white);
59-
--ntp-controls-raised-backdrop: var(--color-black-at-9);
60-
--ntp-controls-raised-fill-primary: var(--color-white);
6158
--ntp-selection-color: var(--color-white);
6259
--ntp-selection-background-color: #3A69EF;
60+
61+
/* Global Colors & Styles - https://www.figma.com/design/3W4vi0zX8hrpQc7zInQQB6/%F0%9F%8E%A8-Global-Colors---Styles?node-id=11-1&p=f&vars=1&m=dev */
62+
/* @todo: This palette is what the native apps use, we should gradually move over to it */
63+
--ntp-surface-tertiary: #FFFFFF;
64+
--ntp-text-primary: #1F1F1F;
65+
--ntp-text-tertiary: rgba(31, 31, 31, 0.4);
66+
--ntp-icons-primary: rgba(31, 31, 31, 0.84);
67+
--ntp-accent-primary: var(--color-blue-50);
68+
--ntp-accent-secondary: var(--color-blue-60);
69+
--ntp-accent-glow: rgba(57, 105, 239, 0.2);
70+
--ntp-accent-content-primary: #FFFFFF;
71+
--ntp-controls-fill-primary: rgba(31, 31, 31, 0.09);
72+
--ntp-controls-raised-backdrop: rgba(0, 0, 0, 0.09);
73+
--ntp-controls-raised-fill-primary: #FFFFFF;
74+
--ntp-decoration-tertiary: rgba(0, 0, 0, 0.09);
75+
--ntp-shadow-primary: rgba(0, 0, 0, 0.05);
76+
--ntp-shadow-secondary: rgba(0, 0, 0, 0.08);
6377
}
6478

6579
[data-theme=dark] {
@@ -74,11 +88,25 @@ body {
7488
--focus-ring: 0px 0px 0px 1px var(--ntp-focus-outline-color), 0px 0px 0px 3px var(--color-white);
7589
--focus-ring-thin: 0px 0px 0px 1px var(--color-white), 0px 0px 0px 1px var(--ntp-focus-outline-color);
7690
--focus-ring-primary: 0px 0px 0px 1px var(--default-dark-background-color), 0px 0px 0px 3px var(--ntp-color-primary);
77-
--ntp-surface-tertiary: rgba(71, 71, 71, 0.66);
78-
--ntp-controls-raised-backdrop: var(--color-black-at-60);
79-
--ntp-controls-raised-fill-primary: var(--color-white-at-18);
8091
--ntp-selection-color: var(--color-white);
8192
--ntp-selection-background-color: var(--color-blue-30);
93+
94+
/* Global Colors & Styles - https://www.figma.com/design/3W4vi0zX8hrpQc7zInQQB6/%F0%9F%8E%A8-Global-Colors---Styles?node-id=11-1&p=f&vars=1&m=dev */
95+
/* @todo: This palette is what the native apps use, we should gradually move over to it */
96+
--ntp-surface-tertiary: rgba(71, 71, 71, 0.66); /* @fixme: This differs from Figma. We're adding alpha so that surfaces blend with custom backgrounds. */
97+
--ntp-text-primary: rgba(255, 255, 255, 0.9);
98+
--ntp-text-tertiary: rgba(255, 255, 255, 0.4);
99+
--ntp-icons-primary: rgba(255, 255, 255, 0.78);
100+
--ntp-accent-primary: var(--color-blue-20);
101+
--ntp-accent-secondary: var(--color-blue-30);
102+
--ntp-accent-glow: rgba(114, 149, 246, 0.2);
103+
--ntp-accent-content-primary: var(--color-blue-80);
104+
--ntp-controls-fill-primary: rgba(249, 249, 249, 0.12);
105+
--ntp-controls-raised-backdrop: rgba(0, 0, 0, 0.6);
106+
--ntp-controls-raised-fill-primary: rgba(255, 255, 255, 0.18);
107+
--ntp-decoration-tertiary: rgba(255, 255, 255, 0.12);
108+
--ntp-shadow-primary: rgba(0, 0, 0, 0.16);
109+
--ntp-shadow-secondary: rgba(0, 0, 0, 0.24);
82110
}
83111

84112
/* This comes from the application settings */

0 commit comments

Comments
 (0)