AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Postcss-Merge-Rules Unsafe Merge With Font Shorthand Breaks Line-Height Cascade

Next.js 16.2.10's production CSS minification (cssnano-simple/postcss-merge-rules) extracts shared `line-height: 22px` from `.a` and `.b` into a merged rule placed before `.b`. Because `.b` still contains the `font: inherit` shorthand later, that shorthand resets line-height to normal, breaking the original cascade priority and causing incorrect rendering.

highConfidence 85%Next.jsPages RouterServer ActionsReact Server ComponentsAffected V16.2.10

Origin Analysis

The built-in postcss-merge-rules plugin merges identical declarations without checking whether one of the source rules includes a CSS shorthand that can reset the merged longhand. In this case, the `font: inherit` shorthand in `.b` resets `line-height` after the merged rule is applied, so the extracted declaration is overridden.
1. Create `.a { line-height: 22px; }` and `.b { font: inherit; font-size: 14px; line-height: 22px; }` in a global CSS file. 2. Run `pnpm build` with next@16.2.10. 3. Open the generated CSS in `.next/static/css/*.css`. 4. Observe `.a, .b { line-height: 22px; }` appears before `.b`'s `font` shorthand, causing `.b`'s line-height to be reset to normal.

Fixing Code Block

Edge Case Audit

This hotfix changes the built-in CSS minification pipeline. It may slightly increase CSS output size because safe rule merging is disabled. The internal import path `next/dist/compiled/css-minimizer-webpack-plugin` may change in future Next.js releases, so test after upgrades. Rollback by removing the webpack override from next.config.js. Also verify that no other CSS minification expectations are broken.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state