Repository navigation
fix: write calc() so postcss-calc 10 parses every package's CSS - #381
Conversation
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.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
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.
gpt-5.6-sol | 𝕏
comark-annotate
comark-badge
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
Latest result Pull request merged. Final answersSession Pull request merged. 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. |
|
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 |

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:
calc(var(--ui-radius,calc(var(--radius,.625rem)/2))*2), acalc()inside avar()fallback inside anothercalc(). Every package carries it throughtheme()incomark-zoom/theme.oklch(from … calc(l + …) c h), where postcss-calc can't read the channel keywordl.This PR halves
--radiusinside the fallback with nocalc()of its own (calc(var(--ui-radius,var(--radius,.625rem)/2)*2)), and writes the lightness asmin(1, l + …), which never clips because only a lightness under .5 rises. Both give the same values. A fixture rendered withcomark-ui/htmlmatches main pixel for pixel in light,.dark, and system dark, and the computed radius matches with--radius,--ui-radius, both, or--comark-radiusset.test/styles.test.tsruns postcss-calc 10 over every built sheet. 35 of the sheets fail on main, and all of them pass here.pnpm readypasses.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: falseonce this is released.