Skip to content

Commit 735d634

Browse files
shipReview: Windows NextSteps feedback (part 2) (#1334)
* chore: Add new expansion option margin setup to Favorites (copied from NextSteps) * chore: Add box-shadow to showHideButton * dark mode * fix: ShowHide button bg * chore: Update showhide btn docs, cleanup * fix: backdrop filter on round btn * fix: backdrop filter again. * chore: Rename classname for clarity --------- Co-authored-by: Shane Osbourne <[email protected]>
1 parent dc0e1a0 commit 735d634

File tree

6 files changed

+48
-20
lines changed

6 files changed

+48
-20
lines changed

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

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,28 @@
1818
width: 2rem;
1919
border-radius: 50%;
2020
padding-inline: 0;
21+
background-color: transparent;
22+
color: var(--ntp-text-muted);
2123

22-
svg rect {
23-
fill-opacity: 0;
24+
25+
.iconBlock {
26+
backdrop-filter: unset;
27+
background-color: transparent;
28+
box-shadow: none;
29+
transition: all 0.3s ease-in;
30+
31+
[data-theme=dark] & {
32+
box-shadow: none;
33+
background-color: transparent;
34+
}
2435
}
2536

2637
&:hover {
27-
transition: all 0.3s ease-in;
28-
svg rect {
29-
fill: black;
30-
fill-opacity: 0.06;
38+
.iconBlock {
39+
background-color: var(--color-black-at-6);
3140

3241
[data-theme=dark] & {
33-
fill: white;
34-
fill-opacity: 0.12;
42+
background-color: var(--color-white-at-12);
3543
}
3644
}
3745
}
@@ -43,6 +51,7 @@
4351

4452
&.withText {
4553
border: 1px solid var(--color-black-at-9);
54+
4655
svg {
4756
margin-right: var(--sp-2);
4857
}
@@ -56,14 +65,32 @@
5665
}
5766
}
5867

59-
> * {
68+
>* {
6069
pointer-events: none;
6170
}
6271

6372
svg {
6473
transition: transform .3s;
6574
}
6675

76+
.iconBlock {
77+
backdrop-filter: blur(48px);
78+
background-color: var(--ntp-surface-background-color);
79+
border-radius: 50%;
80+
height: 1.5rem;
81+
width: 1.5rem;
82+
display: flex;
83+
align-items: center;
84+
justify-content: center;
85+
box-shadow: 0px 2px 4px 0px var(--color-black-at-12), 0px 0px 3px 0px var(--color-black-at-18);
86+
color: var(--ntp-text-muted);
87+
88+
89+
[data-theme="dark"] & {
90+
box-shadow: 0px 2px 4px 0px var(--color-white-at-6), 0px 0px 3px 0px var(--color-white-at-9);
91+
}
92+
}
93+
6794
&[aria-pressed=true] svg {
6895
transform: rotate(-180deg);
6996
}
@@ -86,4 +113,4 @@
86113
}
87114
}
88115
}
89-
}
116+
}

special-pages/pages/new-tab/app/components/ShowHideButton.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import styles from './ShowHide.module.css';
22
import cn from 'classnames';
3-
import { ChevronButton, Chevron } from './Icons.js';
3+
import { Chevron } from './Icons.js';
44
import { Fragment, h } from 'preact';
55

66
/**
77
* Function to handle showing or hiding content based on certain conditions.
88
*
99
* @param {Object} props - Input parameters for controlling the behavior of the ShowHide functionality.
1010
* @param {string} props.text
11-
* @param {boolean} [props.showText]
1211
* @param {() => void} props.onClick
13-
* @param {'none'|'round'} [props.shape]
12+
* @param {'none'|'round'} [props.shape] - when "none", is a full width btn w/ icon inside (used for below Favorites and NextSteps), Round is the PrivacyStats heading button
13+
* @param {boolean} [props.showText] - btn w/ icon and text (used to expand PrivacyStats list), should be used with shape="none"
1414
* @param {import("preact").ComponentProps<'button'>} [props.buttonAttrs]
1515
*/
1616
export function ShowHideButton({ text, onClick, buttonAttrs = {}, shape = 'none', showText = false }) {
@@ -27,7 +27,9 @@ export function ShowHideButton({ text, onClick, buttonAttrs = {}, shape = 'none'
2727
{text}
2828
</Fragment>
2929
) : (
30-
<ChevronButton />
30+
<div class={styles.iconBlock}>
31+
<Chevron />
32+
</div>
3133
)}
3234
</button>
3335
);

special-pages/pages/new-tab/app/favorites/components/Favorites.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function Favorites({ gridRef, favorites, expansion, toggle, openContextMe
4848
const canToggleExpansion = favorites.length >= ROW_CAPACITY;
4949

5050
return (
51-
<div class={cn(styles.root, !canToggleExpansion && styles.bottomSpace)} data-testid="FavoritesConfigured">
51+
<div class={cn(styles.root, !canToggleExpansion && styles.noExpansionBtn)} data-testid="FavoritesConfigured">
5252
<VirtualizedGridRows
5353
WIDGET_ID={WIDGET_ID}
5454
favorites={favorites}

special-pages/pages/new-tab/app/favorites/components/Favorites.module.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
.root {
22
width: 100%;
3-
/* 1px bottom margin for focus box-shadow */
4-
margin: 0 auto 1px;
3+
margin: 0 auto var(--sp-4);
54
display: grid;
65
grid-template-rows: auto auto;
76
grid-template-areas:
87
'grid'
98
'showhide';
109

11-
&.bottomSpace {
10+
&.noExpansionBtn {
1211
margin-bottom: var(--ntp-gap);
1312
}
1413

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
}
146146
}
147147

148-
&.bottomSpace {
148+
&.noExpansionBtn {
149149
margin-bottom: var(--ntp-gap);
150150
}
151151
}

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
@@ -31,7 +31,7 @@ export function NextStepsCardGroup({ types, expansion, toggle, action, dismiss }
3131
const alwaysShown = types.length > 2 ? types.slice(0, 2) : types;
3232

3333
return (
34-
<div class={cn(styles.cardGroup, types.length <= 2 && styles.bottomSpace)} id={WIDGET_ID}>
34+
<div class={cn(styles.cardGroup, types.length <= 2 && styles.noExpansionBtn)} id={WIDGET_ID}>
3535
<NextStepsBubbleHeader />
3636
<div class={styles.cardGrid}>
3737
{alwaysShown.map((type) => (

0 commit comments

Comments
 (0)