fix: restore control typography and hover states
This commit is contained in:
@@ -67,3 +67,35 @@ test("renders map notices through a single toaster", async ({ page }) => {
|
|||||||
|
|
||||||
await expect(page.locator("[data-sonner-toast]")).toHaveCount(1);
|
await expect(page.locator("[data-sonner-toast]")).toHaveCount(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("preserves compact typography in header and agent controls", async ({ page }) => {
|
||||||
|
await page.setViewportSize({ width: 1440, height: 900 });
|
||||||
|
await page.goto("/");
|
||||||
|
|
||||||
|
const headerControl = page.locator("header.acrylic-navigation button.font-semibold:visible").first();
|
||||||
|
const approvalControl = page.getByRole("button", { name: "权限批准模式" });
|
||||||
|
const suggestion = page.locator("[aria-label=推荐问题] button").first();
|
||||||
|
|
||||||
|
await expect(headerControl).toHaveCSS("font-weight", "600");
|
||||||
|
await expect(approvalControl).toHaveCSS("font-size", "12px");
|
||||||
|
await expect(approvalControl).toHaveCSS("line-height", "16px");
|
||||||
|
await expect(suggestion).toHaveCSS("font-size", "12px");
|
||||||
|
await expect(suggestion).toHaveCSS("font-weight", "500");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("lets interactive utilities override surface materials", async ({ page }) => {
|
||||||
|
await page.goto("/");
|
||||||
|
await page.addStyleTag({ content: "*,*::before,*::after{transition:none!important}" });
|
||||||
|
|
||||||
|
const suggestion = page.locator("[aria-label=推荐问题] button").first();
|
||||||
|
const restingBackground = await suggestion.evaluate(
|
||||||
|
(element) => window.getComputedStyle(element).backgroundColor
|
||||||
|
);
|
||||||
|
|
||||||
|
await suggestion.hover();
|
||||||
|
|
||||||
|
const hoverBackground = await suggestion.evaluate(
|
||||||
|
(element) => window.getComputedStyle(element).backgroundColor
|
||||||
|
);
|
||||||
|
expect(hoverBackground).not.toBe(restingBackground);
|
||||||
|
});
|
||||||
|
|||||||
+14
-13
@@ -175,11 +175,6 @@ body {
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
button,
|
|
||||||
input {
|
|
||||||
font: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:focus-visible,
|
button:focus-visible,
|
||||||
input:focus-visible {
|
input:focus-visible {
|
||||||
outline: 2px solid #0f172a;
|
outline: 2px solid #0f172a;
|
||||||
@@ -202,10 +197,6 @@ input:focus-visible {
|
|||||||
.acrylic-navigation,
|
.acrylic-navigation,
|
||||||
.acrylic-panel,
|
.acrylic-panel,
|
||||||
.acrylic-control,
|
.acrylic-control,
|
||||||
.surface-dock,
|
|
||||||
.surface-control,
|
|
||||||
.surface-well,
|
|
||||||
.surface-reading,
|
|
||||||
.glass-transient,
|
.glass-transient,
|
||||||
.material-tone-info,
|
.material-tone-info,
|
||||||
.material-tone-normal,
|
.material-tone-normal,
|
||||||
@@ -257,10 +248,20 @@ input:focus-visible {
|
|||||||
-webkit-backdrop-filter: blur(var(--acrylic-control-blur)) saturate(var(--acrylic-backdrop-saturation));
|
-webkit-backdrop-filter: blur(var(--acrylic-control-blur)) saturate(var(--acrylic-backdrop-saturation));
|
||||||
}
|
}
|
||||||
|
|
||||||
.surface-dock { background-color: var(--surface-dock); }
|
@layer components {
|
||||||
.surface-control { background-color: var(--surface-control); }
|
.surface-dock,
|
||||||
.surface-well { background-color: var(--surface-well); }
|
.surface-control,
|
||||||
.surface-reading { background-color: var(--surface-reading); }
|
.surface-well,
|
||||||
|
.surface-reading {
|
||||||
|
border-color: var(--surface-border);
|
||||||
|
background-clip: padding-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.surface-dock { background-color: var(--surface-dock); }
|
||||||
|
.surface-control { background-color: var(--surface-control); }
|
||||||
|
.surface-well { background-color: var(--surface-well); }
|
||||||
|
.surface-reading { background-color: var(--surface-reading); }
|
||||||
|
}
|
||||||
|
|
||||||
.glass-transient {
|
.glass-transient {
|
||||||
background-color: var(--glass-transient);
|
background-color: var(--glass-transient);
|
||||||
|
|||||||
Reference in New Issue
Block a user