fix(auth): 登录主题 - 跟随应用外观并补齐回归
This commit is contained in:
1 parent
e8c2c40715
commit
d89b55d182
9 files changed
+276
-100
No files matched your search
@@ -50,6 +50,27 @@ func TestAppearanceDefaultsPreserveBuiltInBrand(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuiltInAppearanceSkinAuthPalettesFollowMode(t *testing.T) {
|
||||
for _, skin := range defaultAppearanceSkinThemes() {
|
||||
if skin.Tokens.Light.AuthBackground == skin.Tokens.Dark.AuthBackground || skin.Tokens.Light.AuthCard == skin.Tokens.Dark.AuthCard {
|
||||
t.Errorf("skin %s reuses dark auth surfaces in light mode", skin.ID)
|
||||
}
|
||||
for _, mode := range []struct {
|
||||
name string
|
||||
tokens AppearanceSkinModeTokens
|
||||
}{
|
||||
{name: "light", tokens: skin.Tokens.Light},
|
||||
{name: "dark", tokens: skin.Tokens.Dark},
|
||||
} {
|
||||
for label, foreground := range map[string]string{"text": mode.tokens.Text, "muted": mode.tokens.AuthMuted, "accent": mode.tokens.AuthAccent} {
|
||||
if ratio := appearanceColorContrastRatio(t, foreground, mode.tokens.AuthCard); ratio < 4.5 {
|
||||
t.Errorf("skin %s %s auth %s contrast = %.2f, want at least 4.5", skin.ID, mode.name, label, ratio)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuiltInAppearanceSkinTooltipPairsMeetContrast(t *testing.T) {
|
||||
for _, skin := range defaultAppearanceSkinThemes() {
|
||||
modes := []struct {
|
||||
|
||||
Reference in new issue
Block a user