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';