mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 14:03:33 +09:00
95dc7f0a75cd144e89bbc63e7526b8b35b17532a
**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`
Learning Resources
- Blog
- Documentation
- Brand and Product Design
- Contributing Guide for Devs
- Github Discussions
- Wishlist
- Builder Issues Tracker
- Roadmap
Social Media
Thanks
Thanks to Lost Pixel for providing the visual testing platform that helps us review UI changes and catch visual regressions.
License
- Webstudio core (all functionality in this repository) is free/open-source under AGPL-3.0-or-later.
- sdk-components-animation package (optional) is proprietary. You must accept the Webstudio, Inc. EULA located in sdk-components-animation/LICENSE before using it.
Languages
TypeScript
98.9%
PLpgSQL
0.5%
CSS
0.3%
Shell
0.2%
JavaScript
0.1%
