diff --git a/packages/core/__tests__/e2e/next-ssr.spec.js b/packages/core/__tests__/e2e/next-ssr.spec.js index 9ebb914..39c4030 100644 --- a/packages/core/__tests__/e2e/next-ssr.spec.js +++ b/packages/core/__tests__/e2e/next-ssr.spec.js @@ -3,6 +3,26 @@ import { test, expect } from "@playwright/test"; test.describe.configure({ mode: "serial" }); +test("local fonts load without leaking Tailwind directives into their CSS", async ({ page }) => { + await page.goto("/test", { waitUntil: "networkidle" }); + const stylesheetUrls = await page.locator('link[rel="stylesheet"]').evaluateAll((links) => links.map((link) => link.href)); + let fontCss = ""; + for (const url of stylesheetUrls) { + const response = await page.request.get(url); + expect(response.ok()).toBe(true); + const css = await response.text(); + expect(/@(?:custom-variant|slot)\b/.test(css), `Uncompiled Tailwind directives in ${url}`).toBe(false); + if (css.includes("--font-test")) fontCss += css; + } + expect(fontCss).toContain("@font-face"); + const loadedFontCount = await page.evaluate(async () => { + // Load the bundled font only; Next's Arial fallback may be absent on CI hosts. + const family = window.getComputedStyle(document.body).getPropertyValue("--font-test").split(",")[0].trim(); + return (await document.fonts.load(`16px ${family}`)).length; + }); + expect(loadedFontCount).toBeGreaterThan(0); +}); + test.describe("Zero-UI Comprehensive Test Suite", () => { test.beforeEach(async ({ page }) => { await page.goto("/test", { waitUntil: "networkidle" }); diff --git a/packages/core/__tests__/fixtures/next/app/fonts/OFL.txt b/packages/core/__tests__/fixtures/next/app/fonts/OFL.txt new file mode 100644 index 0000000..dac9ac2 --- /dev/null +++ b/packages/core/__tests__/fixtures/next/app/fonts/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/packages/core/__tests__/fixtures/next/app/fonts/README.md b/packages/core/__tests__/fixtures/next/app/fonts/README.md new file mode 100644 index 0000000..2592910 --- /dev/null +++ b/packages/core/__tests__/fixtures/next/app/fonts/README.md @@ -0,0 +1,4 @@ +`geist-latin.woff2` is the Geist Latin font bundled with Next.js 15.5.18 +(`next/dist/next-devtools/server/font/geist-latin.woff2`). It is used to exercise +`next/font/local` without network requests. Its SIL Open Font License is in +[OFL.txt](./OFL.txt); upstream: https://github.com/vercel/geist-font. diff --git a/packages/core/__tests__/fixtures/next/app/fonts/geist-latin.woff2 b/packages/core/__tests__/fixtures/next/app/fonts/geist-latin.woff2 new file mode 100644 index 0000000..445e0e5 Binary files /dev/null and b/packages/core/__tests__/fixtures/next/app/fonts/geist-latin.woff2 differ diff --git a/packages/core/__tests__/fixtures/next/app/layout.tsx b/packages/core/__tests__/fixtures/next/app/layout.tsx index f945396..83d32f8 100644 --- a/packages/core/__tests__/fixtures/next/app/layout.tsx +++ b/packages/core/__tests__/fixtures/next/app/layout.tsx @@ -1,14 +1,22 @@ import { bodyAttributes } from "@zero-ui/attributes"; +import localFont from "next/font/local"; import "./globals.css"; import ZeroUiRuntime from "./zero-runtime"; +const testFont = localFont({ + src: "./fonts/geist-latin.woff2", + variable: "--font-test", + display: "swap", + style: "normal", +}); + export default function RootLayout({ children }) { return ( {children} diff --git a/packages/core/__tests__/unit/index.test.cjs b/packages/core/__tests__/unit/index.test.cjs index c1f2c80..373be14 100644 --- a/packages/core/__tests__/unit/index.test.cjs +++ b/packages/core/__tests__/unit/index.test.cjs @@ -1,4 +1,5 @@ const postcss = require("postcss"); +const tailwindcss = require("@tailwindcss/postcss"); const { test } = require("node:test"); const assert = require("node:assert"); const fs = require("fs"); @@ -46,7 +47,7 @@ async function runTest(files, callback, cache = true) { } // Run PostCSS - const result = await postcss([plugin()]).process("", { from: undefined }); + const result = await postcss([plugin()]).process("@tailwind utilities;", { from: undefined }); // Run assertions await callback(result); @@ -96,6 +97,70 @@ test("generates body attributes file correctly", async () => { ); }); +test("leaves non-Tailwind CSS unchanged, including generated local-font modules", async () => { + await runTest( + { + "app/test.jsx": `import { useUI } from '@react-zero-ui/core'; + function Component() { + const [theme, setTheme] = useUI('theme', 'light'); + return
; + }`, + }, + async () => { + const stylesheets = [ + ["empty.css", ""], + ["plain.css", '/* @import "tailwindcss"; */ @media (width > 600px) { .label { color: red; } }'], + ["plain.module.css", ".label { color: red; }"], + [ + "testfont_123.module.css", + '@font-face { font-family: "testFont"; src: url("./test.woff2") format("woff2"); font-display: swap; }\n.variable { --font-test: "testFont"; }', + ], + ]; + // A plain stylesheet still triggers attribute generation, even when it runs first. + fs.unlinkSync(getAttrFile()); + for (const [filename, css] of stylesheets) { + const result = await postcss([plugin(), tailwindcss({ optimize: false })]).process(css, { from: path.resolve(filename) }); + assert.strictEqual(result.css, css, `${filename} must not receive Tailwind-only directives`); + assert(result.messages.some((message) => message.type === "dependency" && message.file.endsWith("app/test.jsx"))); + assert(fs.readFileSync(getAttrFile(), "utf8").includes('"data-theme": "light"')); + } + } + ); +}); + +test("compiles Zero UI variants in Tailwind entrypoints and CSS modules", async () => { + await runTest( + { + "app/test.jsx": `import { useUI, useScopedUI } from '@react-zero-ui/core'; + function Component() { + const [theme, setTheme] = useUI('theme', 'light'); + setTheme('dark'); + const [panel, setPanel] = useScopedUI('panel', 'closed'); + setPanel('open'); + return
; + }`, + "base.css": "@tailwind utilities source(none);", + }, + async () => { + const stylesheets = [ + ["globals.css", '@import "./base.css"; @source inline("theme-dark:hidden panel-open:block");'], + ["utilities.css", '@tailwind utilities source(none); @source inline("theme-dark:hidden panel-open:block");'], + ["reference.module.css", '@reference "./base.css"; .label { @apply theme-dark:hidden panel-open:block; }'], + ["apply.module.css", ".label { @apply theme-dark:hidden panel-open:block; }"], + ["variant.module.css", ".label { @variant theme-dark { display: none; } @variant panel-open { display: block; } }"], + ]; + for (const [filename, css] of stylesheets) { + const result = await postcss([plugin(), tailwindcss({ optimize: false })]).process(css, { from: path.resolve(filename) }); + assert.match(result.css, /body\[data-theme=['"]dark['"]\]/, `${filename} must compile the global variant`); + assert.match(result.css, /\[data-panel=['"]open['"]\]/, `${filename} must compile the scoped variant`); + assert.match(result.css, /display: none/); + assert.match(result.css, /display: block/); + assert.doesNotMatch(result.css, /@(?:custom-variant|slot|apply|variant)\b/, `${filename} must not leak Tailwind directives`); + } + } + ); +}); + test("warns instead of auto-initializing when project setup is missing", async () => { await runTest( { @@ -240,7 +305,7 @@ test("watches for file changes", async () => { await new Promise((resolve) => setTimeout(resolve, 500)); // Re-process to check if watcher picked up changes - const result2 = await postcss([plugin()]).process("", { from: undefined }); + const result2 = await postcss([plugin()]).process("@tailwind utilities;", { from: undefined }); assert(result2.css.includes("@custom-variant watch-test-updated"), "Should detect new state"); } @@ -344,7 +409,7 @@ test("handles concurrent file modifications", async () => { } // Final processing should work correctly - const finalResult = await postcss([plugin()]).process("", { from: undefined }); + const finalResult = await postcss([plugin()]).process("@tailwind utilities;", { from: undefined }); assert(finalResult.css.includes("AUTO-GENERATED"), "Should handle rapid changes"); } diff --git a/packages/core/package.json b/packages/core/package.json index 5921981..682bbeb 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@react-zero-ui/core", - "version": "0.4.4", + "version": "0.4.5", "private": false, "scripts": { "build": "rm -rf dist && tsc -p tsconfig.build.json", diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index ddb04f6..cb08d85 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -2,22 +2,74 @@ import { useRef } from "react"; import { cssVar, makeSetter } from "./internal.js"; +/** A value or an updater receiving the current DOM value, falling back to the hook's initial value. */ type UIAction = T | ((prev: T) => T); type ScopedRef = ((node: HTMLElement | null) => void) & { current: HTMLElement | null }; +/** Updates the element attached through `ref` without triggering React re-renders. */ interface ScopedSetterFn { - (action: UIAction): void; // ← SINGLE source of truth + /** Writes a value or applies an updater to the current DOM value. The ref must be attached first. */ + (action: UIAction): void; + /** + * Attach to exactly one scope root. The setter updates this element's `data-*` attribute + * (or CSS variable); render the initial value on the same element. + */ ref?: ScopedRef; cssVar?: typeof cssVar; } +/** Updates `` without triggering React re-renders; updater functions read the current DOM value. */ type GlobalSetterFn = (action: UIAction) => void; +/** + * Returns the supplied initial value and a setter that writes `data-{key}` on ``. + * Updates do not trigger React re-renders; the first value does not track DOM changes. + * Zero UI's PostCSS plugin generates the `key-value:` Tailwind variants used in your source, + * so elements anywhere under `` can respond through CSS. Render alternate states up front. + * + * @param key - Stable kebab-case key, resolvable at build time. + * @param initial - Static default for generated `bodyAttributes`; use the same default everywhere this key is declared. + * @param flag - Pass {@link cssVar} to write `--{key}` instead of a data attribute. + * @returns `[initial, setter]`. The setter accepts a value or an updater reading the current DOM value. + * @example + * ```tsx + * const [, setScrolled] = useUI<"true" | "false">("scrolled", "false"); + * return ( + * + * ); + * ``` + * @see https://zero-ui.dev/docs/api-reference#useuitkey-initial-flag + */ function useUI(key: string, initial: T, flag?: typeof cssVar): [T, GlobalSetterFn] { return [initial, useRef(makeSetter(key, initial, () => document.body, flag)).current as GlobalSetterFn]; } +/** + * Returns the supplied initial value and a setter that writes `data-{key}` on one element. + * Updates do not trigger React re-renders; the first value does not track DOM changes. + * Attach `setter.ref` to the scope root: the setter updates this element's attribute. + * Render the initial `data-{key}` on the same element. Zero UI's PostCSS plugin generates + * `key-value:` Tailwind variants used in your source for this element and its descendants. + * + * @param key - Stable kebab-case key, resolvable at build time. Each hook instance has its own target. + * @param initialValue - Static default; use the same default everywhere this key is declared. + * @param flag - Pass {@link cssVar} to write `--{key}` instead of a data attribute. + * @returns `[initialValue, setter]`. The setter accepts a value or an updater reading the current DOM value. + * @example + * ```tsx + * const [initial, setPanel] = useScopedUI<"open" | "closed">("panel", "closed"); + * return ( + *
+ * + *
Details
+ *
+ * ); + * ``` + * @see https://zero-ui.dev/docs/api-reference#usescopeduitkey-initial-flag + */ function useScopedUI(key: string, initialValue: T, flag?: typeof cssVar): [T, ScopedSetterFn] { // Create a ref to hold the DOM element that will receive the data-* attributes // This allows scoping UI state to specific elements instead of always using document.body diff --git a/packages/core/src/internal.ts b/packages/core/src/internal.ts index 3a53ce7..97e2f73 100644 --- a/packages/core/src/internal.ts +++ b/packages/core/src/internal.ts @@ -1,6 +1,13 @@ // src/internal.ts import type { UIAction } from "./index.js"; +/** + * Pass as the third argument to `useUI` or `useScopedUI` to update an inline CSS variable + * `--{key}` on the target element instead of a `data-*` attribute, without React re-renders. + * Supply the initial CSS value in styles or a `var()` fallback; the hook does not initialize it. + * + * @see https://zero-ui.dev/docs/api-reference#cssvar + */ export const cssVar: unique symbol = Symbol("cssVar"); export function makeSetter(key: string, initialValue: T, getTarget: () => HTMLElement, flag?: typeof cssVar) { diff --git a/packages/core/src/postcss/index.cts b/packages/core/src/postcss/index.cts index 608991e..c52d86b 100644 --- a/packages/core/src/postcss/index.cts +++ b/packages/core/src/postcss/index.cts @@ -2,7 +2,10 @@ /** * @type {import('postcss').PluginCreator} */ -type Root = { prepend: (css: string) => void }; +type Root = { + prepend: (css: string) => void; + walkAtRules: (name: RegExp, callback: () => false | void) => void; +}; type Result = { messages: { type: string; plugin: string; file: string; parent: string }[]; opts: { from: string }; @@ -50,6 +53,18 @@ function warnIfNotInitialized(result: Result, isZeroUiInitialized: RuntimeModule result.warn("[Zero-UI] Zero UI is not initialized. Run `react-zero-ui` to patch your project config.", { plugin: zeroUIPlugin }); } +function usesTailwind(root: Root): boolean { + // Match @tailwindcss/postcss's early-bail directives. @custom-variant alone + // does not trigger compilation, so injecting it into plain CSS (including + // next/font's generated modules) leaks @custom-variant and @slot to the bundler. + let found = false; + root.walkAtRules(/^(import|reference|theme|variant|config|plugin|apply|tailwind)$/, () => { + found = true; + return false; + }); + return found; +} + const plugin = () => { return { postcssPlugin: zeroUIPlugin, @@ -58,8 +73,10 @@ const plugin = () => { const { buildCss, generateAttributesFile, isZeroUiInitialized, processVariants, formatError, registerDeps } = await loadRuntimeModules(); const { finalVariants, initialGlobalValues, sourceFiles } = await processVariants(); - const cssBlock = buildCss(finalVariants); - if (cssBlock?.trim()) root.prepend(cssBlock + "\n"); + if (usesTailwind(root)) { + const cssBlock = buildCss(finalVariants); + if (cssBlock?.trim()) root.prepend(cssBlock + "\n"); + } /* ── register file-dependencies for HMR ─────────────────── */ registerDeps(result, zeroUIPlugin, sourceFiles, result.opts.from ?? ""); diff --git a/wiki/.wiki-system/audit-state.json b/wiki/.wiki-system/audit-state.json index b92f33e..53fa433 100644 --- a/wiki/.wiki-system/audit-state.json +++ b/wiki/.wiki-system/audit-state.json @@ -2,22 +2,22 @@ "version": 1, "pages": { "pages/architecture.md": { - "fingerprint": "sha256:27863bef93f7a6f73ea0834509d1bad9c425eeb3061c297d90a4212191ebebd4" + "fingerprint": "sha256:2f8a7e4305dcd6470b84d51ef75c6023ad9ba1646ac8caace622af19be417a9b" }, "pages/build-test-ci.md": { - "fingerprint": "sha256:e0e832aa0eb7d6964298d7d37b6e0eca3ae700f12b4af9b7e437dc1943d1439e" + "fingerprint": "sha256:4c423b6bb65ee130ac98a4e427f5fc867b9297f18d26bbdaa3ceda0fa6f857b7" }, "pages/core/experimental-runtime.md": { - "fingerprint": "sha256:2fdfe64ad0dd18658ffc2efbeb9e138ff7982b60f7d232b7c844ad91aa50432b" + "fingerprint": "sha256:67d04de39de73d77d8aea0537b0ce85d4513773e60231a6d109e9fa038844bc2" }, "pages/core/runtime-hooks.md": { - "fingerprint": "sha256:85f8659cfb30965e31dee7e826f125e3731d735df4f68b01d6707c9dd50a17c3" + "fingerprint": "sha256:a6c9eb745ba0359265a9fc332763fb561e695cd0724850e485f5bbf14107d31c" }, "pages/core/setup-cli.md": { "fingerprint": "sha256:11358f09ada6750e64039028d9e7aed6581256fa3a6811b29608d5c830ade664" }, "pages/core/variant-extractor.md": { - "fingerprint": "sha256:aad71c1479c002a6d7cb328112a479968b4784290b4e2e8142a3faf3bd9617ca" + "fingerprint": "sha256:e0df7d05d724f8a21ef46437f8dadb72f7b318d46dbdb76c3226d83dda773793" }, "pages/docs-website.md": { "fingerprint": "sha256:427d27f3996c4418070af852ac243ba4921aa36eecead0308abdb126534367b4" @@ -26,7 +26,7 @@ "fingerprint": "sha256:a8f10d30b35e3acf4a26670a61305bb535a15a72e6620b8b7b185dbd8e6f2d02" }, "pages/packages-publishing.md": { - "fingerprint": "sha256:cf1c2f75e2f1b41af4afef00b538e5390123fe26fe063f0ee90a832a58e3d09d" + "fingerprint": "sha256:42f7d54532dbca9bc416e064283f7f64a13df91b92e561af28ba98e72f825929" } } } diff --git a/wiki/decision-log.md b/wiki/decision-log.md index e6d9c77..dd4cd4c 100644 --- a/wiki/decision-log.md +++ b/wiki/decision-log.md @@ -19,3 +19,7 @@ Consumers reported `fast-glob` → `micromatch` → `braces` through core. At re ## 2026-10-19 — Keep Node 22 support when choosing the glob implementation After comparing native glob with both scans, the user chose to retain `tinyglobby` and fix its handling of symlinked source roots. Native glob required exclusion workarounds in the probes, and its directory-symlink support needed by Next layout discovery is available from Node 24.16 / 26.1, not Node 22. Preserving Node 22 with native glob would require extra traversal logic. Separate source-pattern scans restore the old root-symlink behavior without changing the Node requirement or following nested symlinks. [Native API history](https://nodejs.org/docs/latest-v24.x/api/fs.html#fsglobsyncpattern-options); [scan contract](pages/core/variant-extractor.md). + +## 2026-10-24 — Inspect stylesheet directives before injecting variants + +Reproduced Next.js local-font parsing warnings with a packed core fixture. Zero UI injected Tailwind-only rules into generated font CSS, which [Tailwind deliberately skips](https://github.com/tailwindlabs/tailwindcss/blob/v4.2.2/packages/%40tailwindcss-postcss/src/index.ts#L86-L107). Gate injection by stylesheet directives rather than excluding `.module.css`: user modules may legitimately consume Zero UI variants. The regression checks both font loading and served CSS; successful rendering alone missed the warning. [Integration contract and tests](pages/core/variant-extractor.md). diff --git a/wiki/pages/core/variant-extractor.md b/wiki/pages/core/variant-extractor.md index 23efe13..9057ed4 100644 --- a/wiki/pages/core/variant-extractor.md +++ b/wiki/pages/core/variant-extractor.md @@ -9,6 +9,9 @@ paths: - packages/core/src/postcss/index.cts - packages/core/src/postcss/vite.ts - packages/core/src/postcss/utilities.ts + - packages/core/__tests__/unit/index.test.cjs + - packages/core/__tests__/e2e/next-ssr.spec.js + - packages/core/__tests__/fixtures/next/app/layout.tsx --- # Variant Extractor @@ -29,6 +32,8 @@ Source and Next layout discovery use `tinyglobby`. Source discovery scans each p [index.cts](../../../packages/core/src/postcss/index.cts) is the CommonJS PostCSS entry; it lazily imports ESM helpers. Run Zero-UI before Tailwind so custom variants exist when Tailwind processes utilities. It registers source dependencies for watch mode, warns once per working directory when initialization is missing, and still generates attributes. Application config changes belong to [explicit setup](setup-cli.md). +Variant injection requires a directive recognized by Tailwind's PostCSS early-bail check: `@import`, `@reference`, `@theme`, `@variant`, `@config`, `@plugin`, `@apply`, or `@tailwind`. Plain stylesheets, including `next/font/local` generated CSS modules, stay unchanged; attribute generation and dependency registration still run. `@custom-variant` alone does not trigger Tailwind compilation, so unconditional injection leaks it and `@slot` into Next's CSS parser. Preserve CSS modules using Tailwind directives; filename exclusion would block legitimate variants. [PostCSS integration tests](../../../packages/core/__tests__/unit/index.test.cjs) cover both paths; [Next fixture tests](../../../packages/core/__tests__/e2e/next-ssr.spec.js) check local-font loading and served CSS. + Development extraction failures become warnings and leave the server alive; production failures throw. A running dev server alone does not establish that variants compiled successfully. [vite.ts](../../../packages/core/src/postcss/vite.ts) adds Zero-UI/Tailwind to PostCSS and reads generated attributes during HTML transformation; missing startup output can therefore fail before later CSS generation helps. ## Cache debugging