From bb7d9e24a4d0052b431b40f85c2dd4ac4fe0c31d Mon Sep 17 00:00:00 2001 From: Evelyn Gordon Date: Wed, 19 Aug 2026 20:32:16 -0500 Subject: [PATCH] Fix style conflicts --- .../NotificationBanner.css.ts | 36 +++--- .../NotificationBanner.tsx | 118 +++++++++--------- 2 files changed, 82 insertions(+), 72 deletions(-) diff --git a/src/app/components/notification-banner/NotificationBanner.css.ts b/src/app/components/notification-banner/NotificationBanner.css.ts index 554ce8e44..e7cbc8755 100644 --- a/src/app/components/notification-banner/NotificationBanner.css.ts +++ b/src/app/components/notification-banner/NotificationBanner.css.ts @@ -79,19 +79,8 @@ export const BannerContainer = style({ }, }); -export const Banner = style({ - position: 'relative', - overflow: 'hidden', +export const BannerWrapper = style({ pointerEvents: 'all', - display: 'flex', - alignItems: 'center', - gap: config.space.S300, - backgroundColor: color.Surface.Container, - color: color.Surface.OnContainer, - border: `${config.borderWidth.B300} solid ${color.Surface.ContainerLine}`, - borderRadius: toRem(16), - padding: `${config.space.S300} ${config.space.S400}`, - boxShadow: `0 ${toRem(8)} ${toRem(32)} rgba(0, 0, 0, 0.45), 0 ${toRem(2)} ${toRem(8)} rgba(0, 0, 0, 0.3)`, cursor: 'pointer', width: '100%', maxWidth: toRem(420), @@ -104,9 +93,6 @@ export const Banner = style({ transitionTimingFunction: 'ease-out', selectors: { - '&:hover': { - backgroundColor: color.Surface.ContainerHover, - }, '&[data-dismissing=up], &[data-dismissing=left], &[data-dismissing=right]': { animationDuration: '200ms', animationTimingFunction: 'cubic-bezier(0.4, 0, 1, 1)', @@ -128,6 +114,26 @@ export const Banner = style({ }, }); +export const Banner = style({ + position: 'relative', + overflow: 'hidden', + display: 'flex', + alignItems: 'center', + gap: config.space.S300, + backgroundColor: color.Surface.Container, + color: color.Surface.OnContainer, + border: `${config.borderWidth.B300} solid ${color.Surface.ContainerLine}`, + borderRadius: toRem(16), + padding: `${config.space.S300} ${config.space.S400}`, + boxShadow: `0 ${toRem(8)} ${toRem(32)} rgba(0, 0, 0, 0.45), 0 ${toRem(2)} ${toRem(8)} rgba(0, 0, 0, 0.3)`, + + selectors: { + ':hover > &': { + backgroundColor: color.Surface.ContainerHover, + }, + }, +}); + export const BannerIcon = style({ width: toRem(44), height: toRem(44), diff --git a/src/app/components/notification-banner/NotificationBanner.tsx b/src/app/components/notification-banner/NotificationBanner.tsx index b379e02f5..19df95720 100644 --- a/src/app/components/notification-banner/NotificationBanner.tsx +++ b/src/app/components/notification-banner/NotificationBanner.tsx @@ -173,16 +173,9 @@ function BannerItem({ notification, onDismiss }: BannerItemProps) { return (
:( - tabIndex={0} - onKeyDown={(e) => { - if (e.key === 'Enter' || e.key === ' ') handleClick(); - if (e.key === 'Escape') dismiss('up'); - }} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} onTouchStart={handleTouchStart} @@ -194,56 +187,67 @@ function BannerItem({ notification, onDismiss }: BannerItemProps) { willChange: 'transform', }} > - {!notification.event && notification.icon && ( - { - (e.currentTarget as HTMLImageElement).style.display = 'none'; - }} - /> - )} -
- {notification.room && notification.event ? ( - - ) : ( - <> - - {notification.senderName ?? notification.title} - {(notification.roomName || notification.serverName) && ( - - {' ('} - {notification.roomName && `#${notification.roomName}`} - {notification.roomName && notification.serverName && ', '} - {notification.serverName}) - - )} - - {notification.body && } - - )} -
- - { - e.stopPropagation(); - dismiss('up'); - }} - aria-label="Dismiss notification" - > - {sizedIcon(X, '100')} - -
+ className={css.Banner} + onClick={handleClick} + role="button" + tabIndex={0} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') handleClick(); + if (e.key === 'Escape') dismiss('up'); + }} + > + {!notification.event && notification.icon && ( + { + (e.currentTarget as HTMLImageElement).style.display = 'none'; + }} + /> + )} +
+ {notification.room && notification.event ? ( + + ) : ( + <> + + {notification.senderName ?? notification.title} + {(notification.roomName || notification.serverName) && ( + + {' ('} + {notification.roomName && `#${notification.roomName}`} + {notification.roomName && notification.serverName && ', '} + {notification.serverName}) + + )} + + {notification.body && } + + )} +
+ + { + e.stopPropagation(); + dismiss('up'); + }} + aria-label="Dismiss notification" + > + {sizedIcon(X, '100')} + + +
+
); }