Skip to content

objectui init writes an src/index.css with no @import "@object-ui/components/style.css", so the scaffolded app gets none of the library's styles — the one import quick-start and #3884's measurement both call load-bearing #4062

Closed

Description

@yinlianghui

Out-of-scope finding, measured while implementing #3892. Filed separately: #3892's face is the scaffold's version ranges plus deleting its dead tailwind.config.js, and this is a missing line in a different generated file.

Facts (verified on origin/main = 11c1e71e8)

packages/cli/src/commands/init.ts:545 generates the scaffold's entire stylesheet:

@import 'tailwindcss';

That is the whole file. It never imports the component library's published stylesheet.

The library publishes one, and it is a real export: packages/components/package.json declares "./style.css": "./dist/index.css", with dist in files. A local build of the package emits dist/index.css at 161.98 kB.

content/docs/guide/quick-start.md:55-60 — the page an external consumer follows — teaches exactly that import:

@import "tailwindcss";
@import "@object-ui/components/style.css";
@import "@object-ui/fields/style.css";

So the CLI's own scaffold does not do what this project's documentation tells hand-rolled consumers to do.

Why the prebuilt import is the load-bearing one

#3884 measured this directly, against a real install (Tailwind 4.3.3 + @tailwindcss/postcss), and its readings are what make this finding precise rather than speculative:

I want to be explicit that this finding is not "the scaffold is missing @source lines". That was my first hypothesis and #3884 falsifies it: those lines are redundant, cost ~100 kB, and buy 14 selectors none of which are needed. The missing thing is the @import.

Impact

A scaffolded project renders ObjectUI components with no ObjectUI styling — the theme utilities its templates lean on (bg-muted/10, text-muted-foreground, bg-background, shadow-sm on card) have no tokens behind them. Combined with #4061 (empty component registry), objectui init + npm run dev does not currently produce the app its README promises. Severity left to triage.

Not prejudging the fix

Two cells I deliberately did not decide:

  1. Which stylesheets. quick-start names @object-ui/components/style.css and @object-ui/fields/style.css; the scaffold's manifest declares neither @object-ui/fields nor anything that imports it, so copying both lines would declare-vs-import in the wrong direction (create-plugin 生成产物的 dependencies 里 lucide-react: '^0.563.0' 被钉死在 0.563.x(仓内 23 处均为 ^1.28.0),且没有任何生成的源文件 import 它 #3755). Probably components only, matching what the scaffold depends on.
  2. Whether the scaffold should follow quick-start's Vite plugin shape at all. quick-start uses @tailwindcss/vite; the scaffold uses @tailwindcss/postcss + autoprefixer in postcss.config.js. Both are valid Tailwind 4 setups and this finding does not depend on the choice — but the divergence is worth a maintainer's eye, since the two pages are read as one story by a new user.

Measurement I could not do offline: compiling a scaffolded project against real published packages to count what the missing import costs in rules. #3884's fixture is the shape that measurement would take.

Dedup

Searched open issues: init scaffold plugin register components (0 hits), in:title init OR scaffold OR unstyled OR "@source" (#3907, #3892, #3884). #3884 is the docs face (quick-start teaches two redundant @source lines) and explicitly scopes to content/docs/guide/quick-start.md; #3883 is theming/troubleshooting docs; neither covers the CLI scaffold's generated CSS. #3852 migrated the temp-app generator's pipeline, not commands/init.ts.

Related: #3892, #4061. Evidence source: #3884.


Generated by Claude Code

Activity

  1. self-assigned this
    on Aug 10, 2026
  2. yinlianghui commented on Aug 10, 2026

    @yinlianghui
    CollaboratorAuthor

    Triage + release board (objectui seat PM — this repo's board producer): pm:queue + target:v17, class ④ — the scaffolded app renders ObjectUI components with none of the library's styling (the missing @import "@object-ui/components/style.css" is measured load-bearing by #3884's matrix), and the CLI's own output contradicts what quick-start teaches. Same board rationale as #3892.

    Claim: PM loop round 2 — claimed as the second member of the #4061 sweep pair (one PR, two Fixes lines; full claim details on #4061's claim comment).
    Session: session_017Qqyix2QcnpUC9XeYVDzx3


    Generated by Claude Code

  3. yinlianghui commented on Aug 10, 2026

    @yinlianghui
    CollaboratorAuthor

    ACCEPT — closed by PR #4067 together with #4061 (sweep pair). The generated src/index.css now imports @object-ui/components/style.css (the measured load-bearing sheet), gated by a rule — every declared @object-ui/* dependency that publishes a ./style.css export must be imported, and only those — so the fields phantom (#4059) is structurally excluded. The @tailwindcss/postcss vs @tailwindcss/vite docs divergence is flagged in the PR body for the maintainer, unchanged. Full review record on #4061.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions