mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-03 10:37:48 +09:00
**Summary** Validates CSS custom property values as raw CSS token streams before saving/parsing them. This prevents malformed values like `#sd'` from being normalized into `sd` or serialized into broken canvas CSS that invalidates the whole generated rule. **Changes** - Added tokenizer-based validation for custom property values. - Rejects malformed strings, URLs, comments, unmatched blocks, and trailing backslashes. - Preserves raw custom property declaration values before `css-tree` can repair/normalize them. - Prevents custom property value editing from coercing invalid input through fallback parsing like `kebabCase()` or color recovery. - Added regression tests for advanced panel input and CSS data parsing. **Verification** - `pnpm --filter @webstudio-is/css-data test -- parse-css-value.test.ts parse-css.test.ts` - `pnpm --filter @webstudio-is/builder test -- parse-intermediate-or-invalid-value.test.ts parse-style-input.test.ts`