Skip to content

fix: Fix pasted CSS math values#5759

Merged
kof merged 2 commits into
mainfrom
fix/css-math-paste-import
May 14, 2026
Merged

fix: Fix pasted CSS math values#5759
kof merged 2 commits into
mainfrom
fix/css-math-paste-import

Conversation

@kof
Copy link
Copy Markdown
Member

@kof kof commented May 14, 2026

Summary

  • Preserve browser-valid CSS math values during CSS value parsing when css-tree can parse the value but cannot fully validate the property syntax.
  • Fix pasted HTML/imported inline styles like nested clamp() + calc() font sizes being marked invalid.
  • Keep malformed math values and numeric functions in non-numeric properties invalid.
  • Add regression coverage for CSS value parsing and HTML paste/import behavior.

Testing

  • pnpm --filter @webstudio-is/css-data test src/parse-css-value.test.ts
  • pnpm --filter @webstudio-is/builder test app/shared/html.test.tsx app/shared/tailwind/tailwind.test.tsx

Notes

This prevents valid pasted CSS math expressions from becoming invalid style values and crashing the builder on import.

@kof kof merged commit 976ffd3 into main May 14, 2026
19 of 21 checks passed
@kof kof deleted the fix/css-math-paste-import branch May 14, 2026 16:55
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