From c7ba44a91e23d802397e2d48c3684efb0de192a4 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Wed, 29 Oct 2025 13:46:17 +0800 Subject: [PATCH] eink: disable all shadows in E-Ink mode (#2354) --- apps/readest-app/package.json | 2 +- apps/readest-app/src/hooks/useEinkMode.ts | 1 + apps/readest-app/src/styles/globals.css | 6 +++++- apps/readest-app/src/utils/style.ts | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/readest-app/package.json b/apps/readest-app/package.json index e1625fd8..6d2cce7c 100644 --- a/apps/readest-app/package.json +++ b/apps/readest-app/package.json @@ -1,6 +1,6 @@ { "name": "@readest/readest-app", - "version": "0.9.90", + "version": "0.9.91", "private": true, "scripts": { "dev": "dotenv -e .env.tauri -- next dev --turbopack", diff --git a/apps/readest-app/src/hooks/useEinkMode.ts b/apps/readest-app/src/hooks/useEinkMode.ts index 533fb930..c95f3dea 100644 --- a/apps/readest-app/src/hooks/useEinkMode.ts +++ b/apps/readest-app/src/hooks/useEinkMode.ts @@ -7,6 +7,7 @@ export const useEinkMode = () => { } else { document.body.classList.remove('no-transitions'); } + document.documentElement.setAttribute('data-eink', isEink.toString()); }, []); return { applyEinkMode }; diff --git a/apps/readest-app/src/styles/globals.css b/apps/readest-app/src/styles/globals.css index 43b78a0d..1bfb0ac3 100644 --- a/apps/readest-app/src/styles/globals.css +++ b/apps/readest-app/src/styles/globals.css @@ -412,6 +412,10 @@ foliate-view { animation: spin-counterclockwise 1s linear; } +[data-eink="true"] [class*="shadow-"] { + box-shadow: none !important; +} + .no-transitions * { - transition: none !important; + transition: none !important; } \ No newline at end of file diff --git a/apps/readest-app/src/utils/style.ts b/apps/readest-app/src/utils/style.ts index 13ef585a..8792b2ff 100644 --- a/apps/readest-app/src/utils/style.ts +++ b/apps/readest-app/src/utils/style.ts @@ -391,6 +391,8 @@ export const getFootnoteStyles = () => ` } a:any-link { + cursor: default; + pointer-events: none; text-decoration: none; padding: unset; margin: unset;