Skip to content

docs(guide): teach the Tailwind 4 CSS-first setup on theming / troubleshooting / quick-start - #4060

Merged
yinlianghui merged 3 commits into
mainfrom
claude/issue-3883-tailwind4-docs
Aug 10, 2026
Merged

docs(guide): teach the Tailwind 4 CSS-first setup on theming / troubleshooting / quick-start#4060
yinlianghui merged 3 commits into
mainfrom
claude/issue-3883-tailwind4-docs

Conversation

@yinlianghui

@yinlianghuiyinlianghui commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes#3883
Fixes#3884

Two-card docs sweep, one root cause: three consumer-facing guide pages taught Tailwind 3 configuration for a Tailwind 4 library, and #3780's compile matrix measured that the prescriptions cannot restore the utilities they claim to. The theme-class utilities (bg-primary, bg-background, border-input, ring-ring) exist only where the @theme block declaring their tokens is compiled — packages/components/src/index.css, which files does not publish — so scanning the published files, by v4 @source or v3 content, can only regenerate the shape-only utilities the prebuilt style.css already contains.

Per-item checklist

落点beforeafter
content/docs/guide/theming.md §Tailwind Configuration (was 63-114)"Extend your tailwind.config.js…" + a v3 config: darkMode: "class", a content array reaching into node_modules/@object-ui/components/dist, and 30 lines mapping --background / --primary / --border into theme.extend.colors§Tailwind Setup: no config file step, @import "@object-ui/components/style.css" (which carries the @theme block), and an explicit "do not point Tailwind at node_modules" with the reason. Retheming is pointed at token overrides.
content/docs/guide/theming.md §Dark Mode (was :223)"Ensure your Tailwind config uses darkMode: \"class\"…" — dangling once the config section is goneThere is no darkMode option to set; the class-based dark variant is declared in the package's own CSS as @custom-variant dark (&:where(.dark, .dark *)), and what the reader must ensure is that the dark class sits on an ancestor.
content/docs/guide/troubleshooting.md §2 (was 44-66)Cause: "the content paths in your Tailwind config do not include ObjectUI package files"; fix: a tailwind.config.ts with four node_modules globsCause: the published style.css is not imported. Fix: import @object-ui/components/style.css, then check the Tailwind 4 build plugin is wired up (@tailwindcss/postcss or @tailwindcss/vite). Names @object-ui/fields' subpath as unimportable and points at #4059. Closes with a blockquote naming the old prescription as the wrong direction and why.
content/docs/guide/quick-start.md Step 3 (was 55-64)Two @source "../node_modules/@object-ui/…" lines plus "The @source lines let Tailwind see the utility classes used by ObjectUI packages" — the mechanism stated backwardsBoth @source lines deleted (measured +100 kB CSS for 14 selectors, none needed); the sentence now says what style.css actually carries and why no @source is added for these packages.
all three pages, second commiteach taught snippet also carried @import "@object-ui/fields/style.css" — quick-start had it already, and the two rewritten sections had inherited itthat line removed everywhere, and the surrounding prose narrowed to @object-ui/components — the one package measured to publish a working style.css. See the tarball reading below.

git diff --name-only against the merge base is exactly the three files in those rows, nothing else:

 content/docs/guide/quick-start.md | 6 +--
content/docs/guide/theming.md | 69 +++++++++--------------------------
content/docs/guide/troubleshooting.md | 24 +++++-------
3 files changed, 27 insertions(+), 72 deletions(-)

Verification

Measurement basis is #3780's four-cell matrix, quoted in both cards and ruled not re-litigable (#3884 裁决):

⚖️ PM 裁决(维护者已授权代裁,session session_01GTRjn8xBqp75dk7kFupVRt):按实测删 quick-start 的两条 @source node_modules 冗余行,并改写那句会把排查推错方向的解释

依据:#3780/PR3886 的四组入口探针已证预构建 style.css 是 node_modules 扫描所得的严格超集(1410 ⊇ 1331,0 缺失),两条 @source 只多 +100kB 与 14 条无人使用的选择器;解释句(「让 Tailwind 看见 ObjectUI 的 utility class」)与实测机理相反。纯测量结论,无产品取舍。

Spot-verified on origin/main rather than re-run, per that ruling — every claim this PR now makes in prose:

  • packages/components/package.json: "./style.css": "./dist/index.css", and files is ["dist", "README.md", "CHANGELOG.md", "LICENSE"] — so src/index.css, which holds the @theme block, is not published.
  • packages/components has no tailwind.config.js; postcss.config.js loads @tailwindcss/postcss; src/index.css opens @import 'tailwindcss' and uses @theme / @custom-variant / @source.
  • The @custom-variant dark (&:where(.dark, .dark *)) quoted in the dark-mode paragraph is copied verbatim from packages/components/src/index.css:11.
  • Why the fields import left (second commit). The published-artifact reading recorded on #4059: the @object-ui/fields@17.3.0 npm tarball contains zero .css files, so its declared "./style.css": "./dist/index.css" export resolves to nothing and @import '@object-ui/fields/style.css' fails a consumer's build; the control, @object-ui/components@17.3.0, ships package/dist/index.css as expected. That falsifies the cards' "both @import lines are correct" premise for the fields line specifically, which is why removing it here is required rather than a rider — troubleshooting §2 is the page a reader lands on with a broken build, and its fix must not break it further. Nothing is asserted about how fields' widgets are styled without that import: whether their class shapes are a subset of components' published utilities is the open measurement @object-ui/fields declares a ./style.css export but nothing builds dist/index.css for it — the subpath quick-start teaches looks unresolvable #4059 names, and it belongs to that card.

Gates, re-run in the worktree after the rework:

$ node scripts/check-control-bytes.mjs
✅ check-control-bytes: OK (scanned 3927 tracked text file(s); skipped 85 binary).
$ node scripts/check-doc-links.mjs
Links are valid across 7 scan roots.

scripts/__tests__/doc-version-claims.test.ts could not be executed (docs-only worktree, no install), so its matcher was replicated over both revisions of the three pages instead. The flagged set is identical before and after — the two inventoried claims, untouched by this diff:

content/docs/guide/theming.md:320: "Tailwind CSS v3.3" (KNOWN_CLAIMS: unanchored)
content/docs/guide/troubleshooting.md:65: "React 18+" (KNOWN_CLAIMS: unanchored)

Neither direction of that ratchet can trip: nothing was added that the matcher reads as a version literal (a bare major such as "Tailwind 4" is documented in the test header as deliberately unmatched), and no inventoried literal was removed.

Changeset

None owed, and this is the repo's own gate saying so rather than a judgement call:

$ node scripts/check-changeset-presence.mjs
Compared the working tree with 5419f552a (merge-base with origin/main): 3 file(s) changed,
0 of them under the src/ of a package the release covers, 0 under a package changesets ignores,
0 changeset(s) added.
✅ No source of a released package changed in this range, so no changeset is owed.

No skip-changeset label was applied, and none should be: that label is not this repo's convention. .github/workflows/changeset-presence.yml decides from the diff inside the script and reports green when nothing is owed, and scripts/__tests__/ci-cd-pipeline-doc.test.ts:184 records that objectui's skip-changeset label "was never real" (it was documented only by the .github/WORKFLOWS.md inventory deleted in #3724). A label lookup confirms it: skip-changeset does not exist in this repository.

Out of scope, filed not fixed


Generated by Claude Code

…eshooting / quick-start (#3883, #3884)
Three consumer-facing guide pages taught Tailwind 3 configuration for a
Tailwind 4 library, and the prescriptions were measured (#3780) not to
restore the utilities they claimed to.
- theming.md: replace the v3 `tailwind.config.js` section (30 lines of
token -> theme.extend.colors mapping) with the CSS-first import of the
published `style.css`, which already carries the `@theme` block those
tokens come from. Also drop the now-dangling `darkMode: "class"`
instruction in the dark-mode section: the class-based dark variant is
declared in the package's own CSS with `@custom-variant`.
- troubleshooting.md section 2: the cause is the missing `style.css`
import, not missing `content` paths. Scanning node_modules regenerates
only shape-only utilities and can never produce the themed ones.
- quick-start.md: delete the two redundant `@source node_modules` lines
(measured +100 kB CSS for 14 unused selectors) and the explanation that
stated their mechanism backwards.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
@vercel

vercelBot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectuiIgnoredIgnoredAug 10, 2026 2:51am

Request Review

…port (#4059)
The published `@object-ui/fields@17.3.0` tarball contains zero .css files,
so the `"./style.css": "./dist/index.css"` export resolves to nothing and a
consumer's `@import '@object-ui/fields/style.css'` fails their build.
Control: `@object-ui/components@17.3.0` ships `package/dist/index.css`.
That falsifies, for the fields line only, the two cards' premise that both
`@import` lines were correct — so it leaves all three pages here rather than
staying a rider: troubleshooting section 2 in particular is the page whose
prescription must not itself break the reader's build.
Prose now claims only what is measured: `@object-ui/components` publishes a
working `style.css`. Nothing is asserted about how fields' widgets are
styled without it — that disposition needs the subset measurement #4059
names, so the mention points at the issue instead.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
@yinlianghui
yinlianghui marked this pull request as ready for review August 10, 2026 02:55
@yinlianghui
yinlianghui added this pull request to the merge queueAug 10, 2026
Merged via the queue into main with commit eda7fe9Aug 10, 2026
18 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-3883-tailwind4-docs branch August 10, 2026 02:56
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Aug 10, 2026
…declared (objectstack-ai#4059) (objectstack-ai#4076)
`@object-ui/fields` declared `"./style.css": "./dist/index.css"` while its
build was `tsc && vite build` and the package held no `.css` file at all.
Every tarball through 17.3.0 shipped with zero stylesheets, so a consumer's
`@import '@object-ui/fields/style.css'` failed to resolve and broke their
build — the import `content/docs/guide/quick-start.md` taught.
Retiring the export was measured and rejected: 155 classes exist only in this
package, and 17 of them resolve `@theme` tokens declared in unpublished
`@object-ui/components` source, so no consumer-side configuration can produce
them. Removal would have made the field widgets permanently under-styled.
The new sheet is a supplement, not a duplicate: `src/index.css` `@reference`s
components' entry for its theme and emits only the utilities layer, and
`scripts/build-css.mjs` subtracts every rule that package's built sheet already
ships. 21.57 kB / 157 classes instead of ~180 kB of near-duplicate CSS, and it
covers all 152 classes the issue measured as missing.
Also extends `scripts/__tests__/package-files-exist.test.ts` with an
`exports`-reality guard (packability + CSS producibility) so a stylesheet
export with nothing building it cannot recur silently, and re-teaches the
fields import on the three guide pages PR objectstack-ai#4060 removed it from.
Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants

@yinlianghui@claude