From 35902de44b196eb2cdc392d0cef76f861e8e5f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Mon, 16 Mar 2026 02:10:31 +0800 Subject: [PATCH] chore(admin-ui): tokenise topnav hover highlight with primary tint --- public/css/admin-components.css | 8 ++--- ...pnavHoverShouldUsePrimaryTintTokenTest.php | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 tests/Feature/AdminComponentsCssTopnavHoverShouldUsePrimaryTintTokenTest.php diff --git a/public/css/admin-components.css b/public/css/admin-components.css index 86a0472..be0bca9 100644 --- a/public/css/admin-components.css +++ b/public/css/admin-components.css @@ -54,7 +54,7 @@ } .toast-close:hover{ - background:rgba(22, 119, 255, .08); + background:var(--adm-primary-tint-08, rgba(22, 119, 255, .08)); color:var(--adm-text, #0f172a); } @@ -498,7 +498,7 @@ .topnav-brand:hover{ text-decoration:none; - background:rgba(22, 119, 255, .08); + background:var(--adm-primary-tint-08, rgba(22, 119, 255, .08)); } .topnav-menu{ @@ -522,7 +522,7 @@ .topnav-link:hover, .topnav-summary:hover{ text-decoration:none; - background:rgba(22, 119, 255, .08); + background:var(--adm-primary-tint-08, rgba(22, 119, 255, .08)); color:var(--adm-text, #0f172a); } @@ -568,7 +568,7 @@ .topnav-sub:hover{ text-decoration:none; - background:rgba(22, 119, 255, .08); + background:var(--adm-primary-tint-08, rgba(22, 119, 255, .08)); } .topnav-actions{ diff --git a/tests/Feature/AdminComponentsCssTopnavHoverShouldUsePrimaryTintTokenTest.php b/tests/Feature/AdminComponentsCssTopnavHoverShouldUsePrimaryTintTokenTest.php new file mode 100644 index 0000000..496e53f --- /dev/null +++ b/tests/Feature/AdminComponentsCssTopnavHoverShouldUsePrimaryTintTokenTest.php @@ -0,0 +1,33 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_admin_components_css_topnav_hover_should_use_primary_tint_token(): void + { + $this->loginAsPlatformAdmin(); + + $css = file_get_contents(public_path('css/admin-components.css')); + $this->assertIsString($css); + + // 顶部导航 hover 高亮必须走 primary tint token,避免散落 rgba 硬编码。 + $this->assertStringContainsString('.topnav-link:hover', $css); + $this->assertStringContainsString('background:var(--adm-primary-tint-08', $css); + } +}