admin ui: align card border fallback with light theme tokens

This commit is contained in:
萝卜
2026-03-16 00:38:03 +08:00
parent 6a7c8c6dc3
commit 8d629e9dbb
2 changed files with 34 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ a:hover{text-decoration:underline;}
.top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px;} .top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px;}
.page-title{margin:0;} .page-title{margin:0;}
.card{border:1px solid var(--adm-border-color, #334155);border-radius:var(--adm-radius, 14px);padding:16px;background:var(--adm-bg-container, transparent);box-shadow:var(--adm-shadow-sm, none);} .card{border:1px solid var(--adm-border-color, #e5e7eb);border-radius:var(--adm-radius, 14px);padding:16px;background:var(--adm-bg-container, transparent);box-shadow:var(--adm-shadow-sm, none);}
.card + .card{margin-top:20px;} .card + .card{margin-top:20px;}
.card-spaced{margin-bottom:20px;} .card-spaced{margin-bottom:20px;}

View File

@@ -0,0 +1,33 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminBaseCssCardBorderShouldUseThemeBorderColorTest 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_base_css_card_border_should_use_theme_border_color(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-base.css'));
$this->assertIsString($css);
// 卡片边框必须使用浅色主题边框变量,避免残留暗色边框 fallback#334155
$this->assertStringContainsString('.card{border:1px solid var(--adm-border-color, #e5e7eb)', $css);
$this->assertStringNotContainsString('var(--adm-border-color, #334155)', $css);
}
}