Skip to content

Commit 7b948ae

Browse files
committed
default the pill to filled, but allow override
1 parent c237efe commit 7b948ae

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@
8989
color: var(--ntp-text-muted);
9090
}
9191

92+
.fill {
93+
backdrop-filter: blur(48px);
94+
background-color: var(--ntp-surface-background-color);
95+
}
96+
9297
.hover {
9398
transition: background-color .2s;
9499

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ export function ShowHideButtonCircle({ label, onClick, buttonAttrs = {} }) {
2727
* @param {string} props.text
2828
* @param {string|undefined} props.label
2929
* @param {() => void} props.onClick
30+
* @param {boolean} [props.fill=true]
3031
* @param {import("preact").ComponentProps<'button'>} [props.buttonAttrs]
3132
*/
32-
export function ShowHideButtonPill({ label, onClick, text, buttonAttrs = {} }) {
33+
export function ShowHideButtonPill({ label, onClick, text, fill = true, buttonAttrs = {} }) {
3334
// if a different label was given, make the main text aria-hidden=true
3435
const btnText = label ? <span aria-hidden="true">{text}</span> : text;
3536

3637
return (
3738
<button
3839
{...buttonAttrs}
3940
aria-label={label}
40-
class={cn(styles.button, styles.hover, styles.pill)}
41+
class={cn(styles.button, styles.hover, styles.pill, fill && styles.fill)}
4142
data-toggle="true"
4243
onClick={onClick}
4344
>

special-pages/pages/new-tab/app/privacy-stats/components/PrivacyStats.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ function PillShowMoreLess({ expansion }) {
232232
<ShowHideButtonPill
233233
onClick={toggleListExpansion}
234234
label={undefined}
235+
fill={false}
235236
text={expansion === 'collapsed' ? t('ntp_show_more') : t('ntp_show_less')}
236237
buttonAttrs={{
237238
'aria-expanded': expansion === 'expanded',

0 commit comments

Comments
 (0)