Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion apps/desktop/scripts/build-preview-annotation-css.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ const compilerInput = [
annotationSource.replace('@import "tailwindcss";', "@tailwind utilities;"),
].join("\n");
const compiler = await compile(compilerInput, { base: appRoot });
const css = compiler.build([...candidates]);
// Shadow-root styles cannot register @property defaults. Make Tailwind's
// fallback unconditional so border, shadow, and ring utilities have defaults.
const compiledCss = compiler.build([...candidates]);
const css = compiledCss.replace(
/(@layer properties \{\n) @supports [^\n]*\{\n([\s\S]*?)\n \}\n(\})/,
"$1$2\n$3",
);
if (css === compiledCss || /@layer properties\s*\{\s*@supports\b/.test(css)) {
throw new Error("Tailwind @property fallback was not unwrapped; update the pattern above.");
}
const encodedCss = `'${css
.replaceAll("\\", "\\\\")
.replaceAll("'", "\\'")
Expand Down
Loading
Loading