Skip to content

Commit 30ac27a

Browse files
authored
NTP: Refine omnibar background, outline, and elevation styles (#1893)
* Refine popup background, outline, and elevation styles * Update CloseSmallIcon
1 parent 5bcc2e0 commit 30ac27a

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

special-pages/pages/new-tab/app/components/Icons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ export function CloseSmallIcon(props) {
596596
<svg width="16" height="16" fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" {...props}>
597597
<path
598598
fill="currentColor"
599-
d="M10.433 4.683a.625.625 0 1 1 .884.884L8.884 8l2.433 2.433a.625.625 0 1 1-.884.884L8 8.884l-2.433 2.433a.625.625 0 1 1-.884-.884L7.116 8 4.683 5.567a.625.625 0 1 1 .884-.884L8 7.116l2.433-2.433Z"
599+
d="M11.933 3.183a.625.625 0 1 1 .884.884L8.884 8l3.933 3.933a.625.625 0 1 1-.884.884L8 8.884l-3.933 3.933a.625.625 0 1 1-.884-.884L7.116 8 3.183 4.067a.625.625 0 1 1 .884-.884L8 7.116l3.933-3.933Z"
600600
/>
601601
</svg>
602602
);

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

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,36 +41,31 @@
4141
}
4242
}
4343

44+
/* Rest */
4445
.popup {
4546
background: var(--ntp-surface-tertiary);
4647
border-radius: 12px;
47-
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1), 0 4px 8px 0 rgba(0, 0, 0, 0.08);
48+
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1), 0 4px 8px 0 rgba(0, 0, 0, 0.08); /* Elevation 30 */
4849
display: flow-root; /* Prevent margin collapse on .field */
4950
margin: 3px;
51+
outline: 1px solid var(--ntp-controls-raised-backdrop);
5052

5153
body:not([data-background-kind="default"]) & {
5254
backdrop-filter: blur(48px);
5355
background: var(--omnibar-translucent-background-color);
54-
outline: 1px solid var(--ntp-surface-border-color);
5556
}
5657
}
5758

58-
.field {
59-
box-sizing: content-box;
60-
overflow: hidden;
61-
position: relative;
62-
transition: height 200ms ease;
63-
64-
@media (prefers-reduced-motion: reduce) {
65-
transition: none;
66-
}
59+
/* Typing */
60+
.root:focus-within .popup {
61+
box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1), 0 20px 40px 0 rgba(0, 0, 0, 0.08); /* Elevation 90 */
6762
}
6863

6964
/* Focused */
7065
.root:focus-within:has(input:placeholder-shown, textarea:placeholder-shown) .popup {
7166
border-radius: 15px;
7267
border: 2px solid var(--ntp-accent-primary);
73-
box-shadow: none;
68+
box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1), 0 20px 40px 0 rgba(0, 0, 0, 0.08); /* Elevation 90 */
7469
margin: 0;
7570
outline: 2px solid var(--ntp-accent-glow);
7671

@@ -82,10 +77,20 @@
8277
/* Suggestions */
8378
.root:has([role="listbox"]) .popup {
8479
border-radius: 15px;
85-
box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1), 0 20px 40px 0 rgba(0, 0, 0, 0.08);
8680
margin: 0;
8781

8882
.field {
8983
margin: 3px; /* Use margin on .field instead of padding on .popup so that position: absolute respects the spacing */
9084
}
9185
}
86+
87+
.field {
88+
box-sizing: content-box;
89+
overflow: hidden;
90+
position: relative;
91+
transition: height 200ms ease;
92+
93+
@media (prefers-reduced-motion: reduce) {
94+
transition: none;
95+
}
96+
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
body:not([data-background-kind="default"]) & {
1212
backdrop-filter: blur(48px);
13-
background: var(--omnibar-translucent-background-color);
14-
outline: 1px solid var(--ntp-surface-border-color);
1513
}
1614
}
1715

0 commit comments

Comments
 (0)