From 8eb0079bc4fbff82368dc193f0aa7e486f9cc25b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Aug 2026 17:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/routes/user-center/settings.css | 20 +++++++++++++------ ...notification-preferences-contract.test.cjs | 3 ++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/assets/css/routes/user-center/settings.css b/assets/css/routes/user-center/settings.css index 253d2bd5..b8aeb30d 100644 --- a/assets/css/routes/user-center/settings.css +++ b/assets/css/routes/user-center/settings.css @@ -79,15 +79,23 @@ flex: 0 0 44px; } -.uc-notification-switch input { +.uc-notification-switch input[type='checkbox'] { position: absolute; - width: 1px; - height: 1px; - opacity: 0; + inset: 0; + z-index: 1; + width: 100%; + min-width: 0; + height: 100%; + margin: 0; + border: 0; + background: transparent; + box-shadow: none; + opacity: 0 !important; + cursor: pointer; } -.uc-notification-switch input::before, -.uc-notification-switch input::after { +.uc-notification-switch input[type='checkbox']::before, +.uc-notification-switch input[type='checkbox']::after { display: none !important; content: none !important; } diff --git a/tests/widget-system/notification-preferences-contract.test.cjs b/tests/widget-system/notification-preferences-contract.test.cjs index 14900f09..0aff2370 100644 --- a/tests/widget-system/notification-preferences-contract.test.cjs +++ b/tests/widget-system/notification-preferences-contract.test.cjs @@ -50,7 +50,8 @@ test('notification preference UI uses the global toast lifecycle', () => { assert.ok(template.includes(text)); } assert.match(template, /role="switch"/); - assert.match(styles, /\.uc-notification-switch input::before,[\s\S]*?\.uc-notification-switch input::after[\s\S]*?content: none !important/); + assert.match(styles, /\.uc-notification-switch input\[type='checkbox'\][\s\S]*?opacity: 0 !important/); + assert.match(styles, /\.uc-notification-switch input\[type='checkbox'\]::before,[\s\S]*?\.uc-notification-switch input\[type='checkbox'\]::after[\s\S]*?content: none !important/); assert.match(script, /aksrt-notification-preferences-toast/); assert.match(script, /notyf\([^;]+?'load'[^;]+?toastId/); assert.match(script, /notyf\([^;]+?'success'[^;]+?toastId/);