Skip to content

fix: write calc() so postcss-calc 10 parses every package's CSS - #381

Merged
vite-hub[bot] merged 1 commit into
mainfrom
fix/theme-calc
Nov 7, 2026
Merged

vite-hub[bot] merged 1 commit into
mainfrom
fix/theme-calc

Conversation

@onmax

@onmax onmax commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Nuxt's cssnano 8 runs postcss-calc 10.1.1, which prints a parse error for every comark-ui sheet. vitehub.dev turned the calc pass off to get rid of them (preset: ["default", { calc: false }]).

On main, postcss-calc 10.1.1 warns 39 times over the 38 package sheets, from two patterns:

  • The radius fallback, calc(var(--ui-radius,calc(var(--radius,.625rem)/2))*2), a calc() inside a var() fallback inside another calc(). Every package carries it through theme() in comark-zoom/theme.
  • The open tab's lightness in comark-tabs and comark-magic-move, oklch(from … calc(l + …) c h), where postcss-calc can't read the channel keyword l.

This PR halves --radius inside the fallback with no calc() of its own (calc(var(--ui-radius,var(--radius,.625rem)/2)*2)), and writes the lightness as min(1, l + …), which never clips because only a lightness under .5 rises. Both give the same values. A fixture rendered with comark-ui/html matches main pixel for pixel in light, .dark, and system dark, and the computed radius matches with --radius, --ui-radius, both, or --comark-radius set.

test/styles.test.ts runs postcss-calc 10 over every built sheet. 35 of the sheets fail on main, and all of them pass here. pnpm ready passes.

postcss-calc 11.2.3 already parses main's sheets, so this only matters until Nuxt moves to cssnano 9. vitehub.dev can drop calc: false once this is released.

Nuxt minifies CSS with cssnano 8, whose postcss-calc 10 warns on two
patterns in comark-ui's sheets: the radius fallback, a calc() inside a
var() fallback inside another calc(), which every package carries through
the theme, and the relative-color lightness in comark-tabs and
comark-magic-move, a calc() over the channel keyword `l`. vitehub.dev turned
cssnano's calc pass off to quiet them.

The radius halves shadcn's --radius inside the fallback without its own
calc(), and the lightness uses min(1, ...), which never clips. Both compute
the same values. A root test runs postcss-calc 10 over every built sheet.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-07T11:28:42.091461Z
We couldn’t complete this review. Comment @codex review to try again.
2c89b20 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The compatibility rewrite caps valid extended-range lightness values, so the relative-color expression should preserve the previous result before merging.

Reviewed changes in 2c89b20: the shared theme radius fallback and relative-color math were rewritten for postcss-calc 10 compatibility, with a workspace-wide built-CSS regression test and pinned test dependencies.

  • Shared radius fallback — removes the nested calc() while preserving the Nuxt UI and shadcn/ui fallback chain used by package styles.
  • Relative-color math — replaces channel-keyword calc() expressions in tabs and magic-move with syntax accepted by postcss-calc 10.
  • Compatibility coverage — builds and scans every emitted package stylesheet for postcss-calc warnings; the affected suite passed all 43 tests locally.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

Comment thread packages/tabs/src/styles.ts Resolved
@pkg-pr-new

pkg-pr-new Bot commented Nov 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@381

comark-badge

pnpm add https://pkg.pr.new/comark-badge@381

comark-cards

pnpm add https://pkg.pr.new/comark-cards@381

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@381

comark-cast

pnpm add https://pkg.pr.new/comark-cast@381

comark-charts

pnpm add https://pkg.pr.new/comark-charts@381

comark-chat

pnpm add https://pkg.pr.new/comark-chat@381

comark-chips

pnpm add https://pkg.pr.new/comark-chips@381

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@381

comark-code

pnpm add https://pkg.pr.new/comark-code@381

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@381

comark-colors

pnpm add https://pkg.pr.new/comark-colors@381

comark-comments

pnpm add https://pkg.pr.new/comark-comments@381

comark-critic

pnpm add https://pkg.pr.new/comark-critic@381

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@381

comark-details

pnpm add https://pkg.pr.new/comark-details@381

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@381

comark-diff

pnpm add https://pkg.pr.new/comark-diff@381

comark-embed

pnpm add https://pkg.pr.new/comark-embed@381

comark-fields

pnpm add https://pkg.pr.new/comark-fields@381

comark-figure

pnpm add https://pkg.pr.new/comark-figure@381

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@381

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@381

comark-github

pnpm add https://pkg.pr.new/comark-github@381

comark-icon

pnpm add https://pkg.pr.new/comark-icon@381

comark-include

pnpm add https://pkg.pr.new/comark-include@381

comark-keys

pnpm add https://pkg.pr.new/comark-keys@381

comark-links

pnpm add https://pkg.pr.new/comark-links@381

comark-linter

pnpm add https://pkg.pr.new/comark-linter@381

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@381

comark-mark

pnpm add https://pkg.pr.new/comark-mark@381

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@381

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@381

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@381

comark-media

pnpm add https://pkg.pr.new/comark-media@381

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@381

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@381

comark-outline

pnpm add https://pkg.pr.new/comark-outline@381

comark-properties

pnpm add https://pkg.pr.new/comark-properties@381

comark-qr

pnpm add https://pkg.pr.new/comark-qr@381

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@381

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@381

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@381

comark-sources

pnpm add https://pkg.pr.new/comark-sources@381

comark-steps

pnpm add https://pkg.pr.new/comark-steps@381

comark-table

pnpm add https://pkg.pr.new/comark-table@381

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@381

comark-tests

pnpm add https://pkg.pr.new/comark-tests@381

comark-time

pnpm add https://pkg.pr.new/comark-time@381

comark-ui

pnpm add https://pkg.pr.new/comark-ui@381

comark-xref

pnpm add https://pkg.pr.new/comark-xref@381

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@381

commit: 2c89b20

@vite-hub

vite-hub Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Completed 2026-11-07T12:25:32.566Z 12m 24s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

View session

Ready. Pullfrog: P2 extended-range lightness, declined under the policy prohibiting P2-only pushes; rationale posted and thread resolved. Both renderers matched original colors in 14 Chromium comparisons. Package tests: 60 passed; focused Playwright: 12 passed. Lint, postcss-calc checks on four built sheets, and git diff --check passed. No source changes.

@vite-hub

vite-hub Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

For the extended-range lightness finding, I classify the CSS Color 5 range concern as P2: both HTML renderers produced identical computed colors for the original and current expressions in 14 Chromium 156 comparisons, including color(srgb 2 1.5 1) and color(xyz-d65 2 3 2), so I am leaving this edge case unchanged under the repair policy prohibiting P2-only pushes.

@vite-hub
vite-hub Bot merged commit 5483385 into main Nov 7, 2026
6 checks passed
@vite-hub
vite-hub Bot deleted the fix/theme-calc branch November 7, 2026 12:41
@github-actions github-actions Bot mentioned this pull request Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant