Skip to content

Commit 5f23c7a

Browse files
PollyGlotclaude
andcommitted
fix(desktop): make the annotation editor border and shadow actually render
The compact annotation editor was easy to lose while annotating: it had no visible border or shadow even though its classes asked for both. Tailwind registers its --tw-* defaults with @Property, which browsers ignore inside a shadow tree, and only emits the * fallback for engines without @Property. So border, shadow-* and ring-* on the overlay were silently dropped. The build script now lifts that fallback out of its @supports guard so it applies inside the shadow root, and fails if any @supports wrapper is left under @layer properties after a Tailwind bump. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 4ee6bfd commit 5f23c7a

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎apps/desktop/scripts/build-preview-annotation-css.mjs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@ const compilerInput = [
2929
annotationSource.replace('@import "tailwindcss";', "@tailwind utilities;"),
3030
].join("\n");
3131
const compiler = await compile(compilerInput, { base: appRoot });
32-
const css = compiler.build([...candidates]);
32+
// Tailwind registers its `--tw-*` defaults with `@property`, which browsers
33+
// ignore inside a shadow tree, and only emits the `*` fallback for engines
34+
// that lack `@property`. The overlay lives in a shadow root, so lift that
35+
// fallback out of its `@supports` guard: without it `border`, `shadow-*`
36+
// and `ring-*` silently render nothing.
37+
const css = compiler
38+
.build([...candidates])
39+
.replace(/(@layer properties \{\n) @supports [^\n]*\{\n([\s\S]*?)\n \}\n(\})/, "$1$2\n$3");
40+
if (/@layer properties \{\s*@supports/.test(css)) {
41+
throw new Error("Tailwind @property fallback was not unwrapped; update the pattern above.");
42+
}
3343
const encodedCss = `'${css
3444
.replaceAll("\\", "\\\\")
3545
.replaceAll("'", "\\'")

0 commit comments

Comments
 (0)