From 9f65efb19c3f435ef58f6fc81c6909d2a3920f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Wed, 28 Oct 2026 19:03:27 +0000 Subject: [PATCH] fix(cli): check no longer reports outline text as not painted (#6693) --- .../cli/src/commands/layout-audit.browser.js | 5 ++++ .../commands/layout-audit.chromium.test.ts | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/packages/cli/src/commands/layout-audit.browser.js b/packages/cli/src/commands/layout-audit.browser.js index cec24bbc87..e26425dbeb 100644 --- a/packages/cli/src/commands/layout-audit.browser.js +++ b/packages/cli/src/commands/layout-audit.browser.js @@ -1870,6 +1870,11 @@ // unset, so it is the effective fill directly. const fill = cs.webkitTextFillColor || cs.color; if (colorAlpha(fill) > 0.05) return null; + if ( + Number.parseFloat(cs.webkitTextStrokeWidth) > 0 && + colorAlpha(cs.webkitTextStrokeColor) > 0.05 + ) + return null; const clip = cs.webkitBackgroundClip || cs.backgroundClip || ""; if (/text/i.test(clip)) { const bgImage = cs.backgroundImage || "none"; diff --git a/packages/cli/src/commands/layout-audit.chromium.test.ts b/packages/cli/src/commands/layout-audit.chromium.test.ts index 4e0318b38f..a670a030e1 100644 --- a/packages/cli/src/commands/layout-audit.chromium.test.ts +++ b/packages/cli/src/commands/layout-audit.chromium.test.ts @@ -455,6 +455,31 @@ describe.runIf(executablePath)("layout audit in Chromium", () => { }, ); + it.each([ + { + name: "outline text (transparent fill, visible stroke)", + style: "color:transparent;-webkit-text-stroke:4px #fff", + flagged: false, + }, + { name: "transparent text with no stroke", style: "color:transparent", flagged: true }, + { + name: "transparent text with an invisible stroke", + style: "color:transparent;-webkit-text-stroke:4px transparent", + flagged: true, + }, + { + name: "transparent text with a zero-width stroke", + style: "color:transparent;-webkit-text-stroke:0 #fff", + flagged: true, + }, + ])("judges $name by what it paints", async ({ style, flagged }) => { + const codes = await auditCodes(` +
+

OUTLINE

+
`); + expect(codes.includes("text_not_painted")).toBe(flagged); + }); + describe("craft sampling", () => { async function sample(body: string) { const page = await browser.newPage();