chore(admin-ui): add table tokens and refine list-card table header/hover

This commit is contained in:
萝卜
2026-03-16 01:29:07 +08:00
parent cd9bf2dbc4
commit cda69f4716
3 changed files with 48 additions and 0 deletions

View File

@@ -163,6 +163,14 @@
padding:12px 12px; padding:12px 12px;
} }
.list-card-table thead th{
background:var(--adm-table-header-bg, #fafafa);
}
.list-card-table tbody tr:hover td{
background:var(--adm-table-row-hover-bg, rgba(22, 119, 255, .04));
}
/* 可复用PageHeader参考 Ant Design Pro标题区 + 描述 + 右侧操作区) */ /* 可复用PageHeader参考 Ant Design Pro标题区 + 描述 + 右侧操作区) */
.page-header{ .page-header{
width:100%; width:100%;

View File

@@ -40,6 +40,10 @@
--adm-input-border-hover: #a3aab6; --adm-input-border-hover: #a3aab6;
--adm-input-text: #0f172a; --adm-input-text: #0f172a;
/* 表格(接近 Ant Design 表头/hover */
--adm-table-header-bg: #fafafa;
--adm-table-row-hover-bg: rgba(22, 119, 255, .04);
/* 状态色(接近 Ant Design */ /* 状态色(接近 Ant Design */
--adm-success: #16a34a; --adm-success: #16a34a;
--adm-warning: #f59e0b; --adm-warning: #f59e0b;

View File

@@ -0,0 +1,36 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminComponentsCssListCardTableShouldUseThemeTableTokensTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_admin_components_css_list_card_table_should_use_theme_table_tokens(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-components.css'));
$this->assertIsString($css);
// 表头背景与 hover 背景必须走主题 token便于统一风格与后续换肤。
$this->assertStringContainsString('.list-card-table thead th{', $css);
$this->assertStringContainsString('background:var(--adm-table-header-bg, #fafafa)', $css);
$this->assertStringContainsString('.list-card-table tbody tr:hover td{', $css);
$this->assertStringContainsString('background:var(--adm-table-row-hover-bg, rgba(22, 119, 255, .04))', $css);
}
}