Here added new utility for builder to support parsing css fragments in
style controls like background, transition, shadows etc.
The idea is to use regular parseCss where possible and fallback to
specified property parsing.
This way we do not need to strip property name manually and can always
have shorthands expanded in result.
Also user can paste multiple properties at once like background-color
and background-image when describe gradient.
<img width="266" alt="Screenshot 2024-07-11 at 16 38 06"
src="https://github.com/webstudio-is/webstudio/assets/5635476/8d3b8454-0f8a-48b2-adbd-389a28993e3a">
Turns out no-internal-imports did not forbid anything out of the box but
requires specifying specific folders to forbid. This does not scale well
and this rule mostly harms because requires either excluding each
package with submodules or suppressing it with comment.
## Description
`box-shadow` and `text-shadow` both share the same syntax signature.
https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow#syntaxhttps://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow#syntax
The only difference is `text-shadow` don't have `inset` and `spread`
values. And added a extractor which can be used in future for
text-shadow UI.
## Code Review
- [ ] hi @kof, I need you to do
- conceptual review (architecture, feature-correctness)
- detailed review (read every line)
- test it on preview
## Before requesting a review
- [x] made a self-review
- [x] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [x] added tests
Css-data now responsible for generated data and parsers which requires
heavy dependencies like csstree and openai.
Here moved style schema into css-engine which makes is responsible for
own input representation. So now schema and serialization are co-located
in single package.
Cli install size
```diff
du -ck node_modules
- 42680
+ 35516
```
Here I replaced previous theming solution with generated code. It allows
us to not have tailwind in dependencies and not bloat cli installation.
Additionally all values are preparsed into our internal format to avoid
parsing at runtime when meta is imported and not have parsing
dependencies like csstree (still there for now).
Cli install size
```diff
du -ck node_modules
- 57880
+ 42680
```