chore(admin-ui): tokenise page-header/stat-card in admin-components css
This commit is contained in:
@@ -18,22 +18,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toast{
|
.toast{
|
||||||
background:#111827;
|
background:var(--adm-bg-container, #ffffff);
|
||||||
border:1px solid #334155;
|
border:1px solid var(--adm-border-color, #e5e7eb);
|
||||||
border-left-width:4px;
|
border-left-width:4px;
|
||||||
border-radius:12px;
|
border-radius:var(--adm-radius, 12px);
|
||||||
padding:12px 12px;
|
padding:12px 12px;
|
||||||
color:#e5e7eb;
|
color:var(--adm-text, #0f172a);
|
||||||
box-shadow:0 14px 30px rgba(0,0,0,.35);
|
box-shadow:0 12px 30px rgba(15, 23, 42, .12);
|
||||||
display:flex;
|
display:flex;
|
||||||
align-items:flex-start;
|
align-items:flex-start;
|
||||||
justify-content:space-between;
|
justify-content:space-between;
|
||||||
gap:12px;
|
gap:12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-success{border-left-color:#16a34a;}
|
.toast-success{border-left-color:var(--adm-success, #16a34a);}
|
||||||
.toast-warning{border-left-color:#f59e0b;}
|
.toast-warning{border-left-color:var(--adm-warning, #f59e0b);}
|
||||||
.toast-error{border-left-color:#ef4444;}
|
.toast-error{border-left-color:var(--adm-error, #ef4444);}
|
||||||
|
|
||||||
.toast-content{
|
.toast-content{
|
||||||
font-size:13px;
|
font-size:13px;
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
appearance:none;
|
appearance:none;
|
||||||
border:none;
|
border:none;
|
||||||
background:transparent;
|
background:transparent;
|
||||||
color:#94a3b8;
|
color:var(--adm-text-muted, #94a3b8);
|
||||||
font-size:18px;
|
font-size:18px;
|
||||||
line-height:1;
|
line-height:1;
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
@@ -54,8 +54,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toast-close:hover{
|
.toast-close:hover{
|
||||||
background:#1f2937;
|
background:rgba(22, 119, 255, .08);
|
||||||
color:#e5e7eb;
|
color:var(--adm-text, #0f172a);
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-inline-row{
|
.form-inline-row{
|
||||||
@@ -114,9 +114,9 @@
|
|||||||
.page-header{
|
.page-header{
|
||||||
width:100%;
|
width:100%;
|
||||||
padding:16px;
|
padding:16px;
|
||||||
border:1px solid #e5e7eb;
|
border:1px solid var(--adm-border-color, #e5e7eb);
|
||||||
border-radius:12px;
|
border-radius:var(--adm-radius, 12px);
|
||||||
background:#ffffff;
|
background:var(--adm-bg-container, #ffffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header-main{
|
.page-header-main{
|
||||||
@@ -129,14 +129,14 @@
|
|||||||
.page-header-title{
|
.page-header-title{
|
||||||
font-size:18px;
|
font-size:18px;
|
||||||
font-weight:700;
|
font-weight:700;
|
||||||
color:#0f172a;
|
color:var(--adm-text, #0f172a);
|
||||||
line-height:1.2;
|
line-height:1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header-subtitle{
|
.page-header-subtitle{
|
||||||
margin-top:6px;
|
margin-top:6px;
|
||||||
font-size:13px;
|
font-size:13px;
|
||||||
color:#64748b;
|
color:var(--adm-text-secondary, #64748b);
|
||||||
line-height:1.45;
|
line-height:1.45;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
display:flex;
|
display:flex;
|
||||||
flex-wrap:wrap;
|
flex-wrap:wrap;
|
||||||
gap:12px;
|
gap:12px;
|
||||||
color:#64748b;
|
color:var(--adm-text-secondary, #64748b);
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,21 +177,21 @@
|
|||||||
|
|
||||||
.stat-card-title{
|
.stat-card-title{
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
color:#64748b;
|
color:var(--adm-text-secondary, #64748b);
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-card-value{
|
.stat-card-value{
|
||||||
margin-top:10px;
|
margin-top:10px;
|
||||||
font-size:22px;
|
font-size:22px;
|
||||||
font-weight:800;
|
font-weight:800;
|
||||||
color:#0f172a;
|
color:var(--adm-text, #0f172a);
|
||||||
letter-spacing:.2px;
|
letter-spacing:.2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-card-footnote{
|
.stat-card-footnote{
|
||||||
margin-top:8px;
|
margin-top:8px;
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
color:#94a3b8;
|
color:var(--adm-text-muted, #94a3b8);
|
||||||
}
|
}
|
||||||
|
|
||||||
.collapsible > summary{
|
.collapsible > summary{
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminComponentsCssPageHeaderShouldUseThemeTokensTest 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_page_header_should_use_theme_tokens(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$css = file_get_contents(public_path('css/admin-components.css'));
|
||||||
|
$this->assertIsString($css);
|
||||||
|
|
||||||
|
// PageHeader 组件必须走主题令牌,避免后续统一换肤/统一基线时需要全局搜替换。
|
||||||
|
$this->assertStringContainsString('.page-header{', $css);
|
||||||
|
$this->assertStringContainsString('border:1px solid var(--adm-border-color, #e5e7eb)', $css);
|
||||||
|
$this->assertStringContainsString('background:var(--adm-bg-container, #ffffff)', $css);
|
||||||
|
$this->assertStringContainsString('border-radius:var(--adm-radius, 12px)', $css);
|
||||||
|
|
||||||
|
// 标题/副标题要使用文本 token。
|
||||||
|
$this->assertStringContainsString('color:var(--adm-text, #0f172a)', $css);
|
||||||
|
$this->assertStringContainsString('color:var(--adm-text-secondary, #64748b)', $css);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user