Fix style conflicts

This commit is contained in:
Evelyn Gordon committed 2026-08-19 20:32:16 -05:00
1 parent a47a12dda4
commit bb7d9e24a4
2 files changed
+82 -72

No files matched your search

@@ -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),
@@ -173,16 +173,9 @@ function BannerItem({ notification, onDismiss }: BannerItemProps) {
return (
<div
className={css.Banner}
className={css.BannerWrapper}
data-dismissing={dismissing}
data-swiping={gesture !== undefined}
onClick={handleClick}
// role="button" // TODO: This breaking everything >:(
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 && (
<img
src={notification.icon}
alt=""
className={css.BannerIcon}
onError={(e) => {
(e.currentTarget as HTMLImageElement).style.display = 'none';
}}
/>
)}
<div className={css.BannerContent}>
{notification.room && notification.event ? (
<BannerMessage notification={notification} />
) : (
<>
<Text size="T300" truncate className={css.BannerTitle}>
{notification.senderName ?? notification.title}
{(notification.roomName || notification.serverName) && (
<span className={css.BannerSubtitle}>
{' ('}
{notification.roomName && `#${notification.roomName}`}
{notification.roomName && notification.serverName && ', '}
{notification.serverName})
</span>
)}
</Text>
{notification.body && <BodyText text={notification.body} hovered={paused} />}
</>
)}
</div>
<Box shrink="No">
<IconButton
size="300"
variant="Surface"
fill="None"
radii="300"
onClick={(e) => {
e.stopPropagation();
dismiss('up');
}}
aria-label="Dismiss notification"
>
{sizedIcon(X, '100')}
</IconButton>
</Box>
<div
className={css.ProgressBar}
data-paused={paused}
style={{ animationDuration: `${BANNER_DURATION_MS}ms` }}
/>
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 && (
<img
src={notification.icon}
alt=""
className={css.BannerIcon}
onError={(e) => {
(e.currentTarget as HTMLImageElement).style.display = 'none';
}}
/>
)}
<div className={css.BannerContent}>
{notification.room && notification.event ? (
<BannerMessage notification={notification} />
) : (
<>
<Text size="T300" truncate className={css.BannerTitle}>
{notification.senderName ?? notification.title}
{(notification.roomName || notification.serverName) && (
<span className={css.BannerSubtitle}>
{' ('}
{notification.roomName && `#${notification.roomName}`}
{notification.roomName && notification.serverName && ', '}
{notification.serverName})
</span>
)}
</Text>
{notification.body && <BodyText text={notification.body} hovered={paused} />}
</>
)}
</div>
<Box shrink="No">
<IconButton
size="300"
variant="Surface"
fill="None"
radii="300"
onClick={(e) => {
e.stopPropagation();
dismiss('up');
}}
aria-label="Dismiss notification"
>
{sizedIcon(X, '100')}
</IconButton>
</Box>
<div
className={css.ProgressBar}
data-paused={paused}
style={{ animationDuration: `${BANNER_DURATION_MS}ms` }}
/>
</div>
</div>
);
}