From 906572dab69c19b3fb07667f338bdc68ac27e081 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Mon, 20 Jul 2026 22:09:16 -0500 Subject: [PATCH] fix(ui): scope hovers to mouse --- src/app/styles/overrides/General.css.ts | 16 ++++++++-------- src/app/styles/overrides/TouchDevices.css | 23 +++++++++++++++++++++++ src/index.tsx | 1 + 3 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 src/app/styles/overrides/TouchDevices.css diff --git a/src/app/styles/overrides/General.css.ts b/src/app/styles/overrides/General.css.ts index 78753f1b4..543079ffe 100644 --- a/src/app/styles/overrides/General.css.ts +++ b/src/app/styles/overrides/General.css.ts @@ -2,10 +2,10 @@ import { globalStyle } from '@vanilla-extract/css'; globalStyle( ` - button, - [role="button"], - [class*="Button"], - [class*="Chip"], + button, + [role="button"], + [class*="Button"], + [class*="Chip"], [class*="MenuItem"] `, { @@ -15,9 +15,9 @@ globalStyle( globalStyle( ` - button:active, - [role="button"]:active, - [class*="Button"]:active, + button:active, + [role="button"]:active, + [class*="Button"]:active, [class*="Chip"]:active `, { @@ -27,7 +27,7 @@ globalStyle( globalStyle( ` - button:hover, + button:hover, [role="button"]:hover `, { diff --git a/src/app/styles/overrides/TouchDevices.css b/src/app/styles/overrides/TouchDevices.css new file mode 100644 index 000000000..d09fbf7a5 --- /dev/null +++ b/src/app/styles/overrides/TouchDevices.css @@ -0,0 +1,23 @@ +/* + * Overrides for touch-only devices. + * - Tapping a button no longer scales or translates to avoid weird ghost press effects. + * - Hovering no longer leaves a background color highlight on the timeline. + */ + +@media (hover: none) { + html body button:active, + html body [role="button"]:active, + html body [class*="Button"]:active, + html body [class*="Chip"]:active { + transform: none !important; + } + + html body button:hover, + html body [role="button"]:hover { + transform: none !important; + } + + html body [data-message-id][data-message-item]:hover { + background-color: transparent !important; + } +} diff --git a/src/index.tsx b/src/index.tsx index cc5c5ec8d..43e5e7136 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -17,6 +17,7 @@ import './app/styles/themes.css'; import './app/styles/overrides/General.css'; import './app/styles/overrides/Privacy.css'; import './app/styles/overrides/TauriDesktop.css'; +import './app/styles/overrides/TouchDevices.css'; import { createLogger } from './app/utils/debug'; import { installConsolePasteScamWarning } from './app/utils/consolePasteScamWarning'; import { registerMatrixUriProtocol } from './app/plugins/matrix-uri';