Skip to content

Commit 8760e79

Browse files
vkraucunasShane Osbourne
andauthored
NTP Mac style parity (#1263)
* feat: Add standard and accentBranded Windows styles to shared Button * chore: Update RMF to do both Mac and Windows design * fix: center align customizer button children * chore: Update section headers to h2, batten down the font styles * chore: rm extra lines * chore: Rename button variant * chore: Update variant name * fix: Test * fix: Bring focus ring value to the shared Button * fix: Icon only ShowHideButton hover * fix: Reread the feedback * fix: update the Button css selector for windows * fix: Rearrange new-tab/app/index.js calls * chore: removes possibly breaking changes to button * limit customizer styles to feature-flagged --------- Co-authored-by: Shane Osbourne <[email protected]>
1 parent b1e6f22 commit 8760e79

File tree

16 files changed

+186
-131
lines changed

16 files changed

+186
-131
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function App({ children }) {
2828

2929
return (
3030
<div class={cn(styles.layout)} ref={wrapperRef} data-drawer-visibility={visibility}>
31-
<main class={cn(styles.main)}>
31+
<main class={cn(styles.main)} data-customizer-kind={customizerKind}>
3232
<div class={styles.tube} data-platform={platformName}>
3333
<WidgetList />
3434
<CustomizerMenuPositionedFixed>

special-pages/pages/new-tab/app/components/App.module.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ body:has([data-reset-layout="true"]) .tube {
4444
}
4545

4646
.main {
47-
overflow: hidden;
48-
height: 100vh;
47+
&[data-customizer-kind="drawer"] {
48+
overflow: hidden;
49+
height: 100vh;
50+
}
4951
}
52+
5053
.active {}
5154

5255
.aside {

special-pages/pages/new-tab/app/components/Icons.module.css

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.chevronButton {
2-
&:hover .chevronCircle {
2+
transition: all .3s;
3+
.chevronCircle {
34
fill: black;
45
fill-opacity: 0.06;
56

@@ -10,11 +11,6 @@
1011
}
1112
}
1213

13-
.chevronCircle {
14-
transition: all .3s;
15-
fill-opacity: 0;
16-
}
17-
1814
.chevronArrow {
1915
@media screen and (prefers-color-scheme: dark) {
2016
fill: white;

special-pages/pages/new-tab/app/components/ShowHide.module.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@
1919
border-radius: 50%;
2020
padding-inline: 0;
2121

22+
svg rect {
23+
fill-opacity: 0;
24+
}
25+
26+
&:hover {
27+
transition: all 0.3s ease-in;
28+
svg rect {
29+
fill: black;
30+
fill-opacity: 0.06;
31+
32+
@media screen and (prefers-color-scheme: dark) {
33+
fill: white;
34+
fill-opacity: 0.12;
35+
}
36+
}
37+
}
38+
2239
&:focus-visible {
2340
box-shadow: var(--focus-ring);
2441
}

special-pages/pages/new-tab/app/customizer/components/Customizer.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
padding: var(--sp-2) var(--sp-3);
2828
cursor: pointer;
2929
display: flex;
30+
align-items: center;
3031
gap: calc(6 * var(--px-in-rem));
3132
color: var(--ntp-text-normal);
3233

special-pages/pages/new-tab/app/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ export async function init(root, messaging, telemetry, baseEnvironment) {
6969
messaging.reportPageException({ message });
7070
};
7171

72+
// install global side effects that are not specific to any widget
73+
installGlobalSideEffects(environment, settings);
74+
7275
// return early if we're in the 'components' view.
7376
if (environment.display === 'components') {
7477
return renderComponents(root, environment, settings, strings);
7578
}
7679

77-
// install global side effects that are not specific to any widget
78-
installGlobalSideEffects(environment, settings);
79-
8080
// Resolve the entry points for each selected widget
8181
const entryPoints = await resolveEntryPoints(init.widgets, didCatch);
8282

special-pages/pages/new-tab/app/next-steps/components/NextSteps.module.css

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
}
2222

2323
.title {
24+
font-size: var(--body-font-size);
2425
font-weight: 590;
25-
line-height: var(--sp-4);
26+
line-height: var(--body-line-height);
2627
letter-spacing: -0.08px;
2728
color: var(--ntp-text-normal);
2829
margin-bottom: var(--sp-1);
@@ -131,15 +132,18 @@
131132

132133
div {
133134
background-color: var(--ntp-color-primary);
134-
font-size: calc(11 * var(--px-in-rem));
135135
height: calc(20 * var(--px-in-rem));
136-
line-height: normal;
137-
font-weight: 600;
138-
letter-spacing: 0.06px;
139-
color: var(--ntp-text-on-primary);
140136
display: flex;
141137
align-items: center;
142138
justify-content: center;
139+
140+
h2 {
141+
color: var(--ntp-text-on-primary);
142+
letter-spacing: 0.06px;
143+
font-weight: 600;
144+
line-height: normal;
145+
font-size: calc(11 * var(--px-in-rem));
146+
}
143147
}
144148
}
145149

@@ -160,7 +164,6 @@
160164
:root:has(body[data-platform-name="windows"]) {
161165
.nextStepsCard .title {
162166
font-weight: 700;
163-
line-height: calc(20 * var(--px-in-rem));
164167
letter-spacing: normal;
165168
}
166169
}

special-pages/pages/new-tab/app/next-steps/components/NextStepsCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function NextStepsCard({ type, dismiss, action }) {
1717
return (
1818
<div class={styles.card}>
1919
<img src={`./icons/${message.icon}-128.svg`} alt="" class={styles.icon} />
20-
<p class={styles.title}>{message.title}</p>
20+
<h3 class={styles.title}>{message.title}</h3>
2121
<p class={styles.description}>{message.summary}</p>
2222
<button class={styles.btn} onClick={() => action(message.id)}>
2323
{message.actionText}

special-pages/pages/new-tab/app/next-steps/components/NextStepsGroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function NextStepsBubbleHeader() {
7979
/>
8080
</svg>
8181
<div>
82-
<p>{text}</p>
82+
<h2>{text}</h2>
8383
</div>
8484
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="20" viewBox="0 0 10 20" fill="none">
8585
<path

special-pages/pages/new-tab/app/next-steps/integrations-tests/next-steps.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test.describe('newtab NextSteps cards', () => {
5454
// expand the section
5555
await page.getByLabel('Show More', { exact: true }).click();
5656

57-
await expect(page.locator('p').filter({ hasText: 'Block Cookie Pop-ups' })).toBeVisible();
57+
await expect(page.locator('h3').filter({ hasText: 'Block Cookie Pop-ups' })).toBeVisible();
5858
await page.getByRole('button', { name: 'Try DuckPlayer' }).click();
5959
await ntp.mocks.waitForCallCount({ method: 'nextSteps_action', count: 1 });
6060
});

0 commit comments

Comments
 (0)