chore(admin-ui): add table tokens and refine list-card table header/hover
This commit is contained in:
@@ -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%;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user