Ivan Starkov 4af2ab9e1b Typing "-" in unitless value types should select the unitless (#1060)
## Description

1. What is this PR about (link the issue and add a short description)

closes #1033
Also fixes that 0 for props like top, left etc showed as 

<img width="225" alt="image"
src="https://user-images.githubusercontent.com/5077042/219710181-a8e7ecf4-638f-459a-a8b7-0dcd879768a2.png">

Now 

<img width="219" alt="image"
src="https://user-images.githubusercontent.com/5077042/219710399-afa8af98-d8f9-4328-8bf5-083e6be2d6ba.png">

Also now if the property allows `unitless` we allow the selection of `-`
unit from UnitSelect _(top can be unitless if value is 0)_

<img width="230" alt="image"
src="https://user-images.githubusercontent.com/5077042/219710645-a91a05d3-0f2f-4fc8-b0b2-ede9a7c8e058.png">

And not if not _(top can't be unitless if value is not 0)_

<img width="141" alt="image"
src="https://user-images.githubusercontent.com/5077042/219710884-74af7cba-76d0-4e5e-a6e4-ab2c7f910c45.png">








## Steps for reproduction

See tests what's accepted, for unitless properties, it's allowed to
enter for lineHeight

`10-`
`20 -`
`10 + 20-`

All become unitless.


For `top` you can enter `0-` it becomes unitless 0
then for example `10` it becomes `10px` as `top does not support
unitless 10



## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)

- [ ] hi @TrySound , I need you to do
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [x] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [x] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-02-17 21:50:26 +04:00
2023-02-14 11:15:24 +01:00
2022-07-04 19:59:42 +02:00
2023-01-29 18:05:13 +03:00
2022-07-22 19:18:21 +00:00
2022-06-22 15:00:00 +02:00
2022-03-13 04:22:21 +00:00
2023-02-14 21:59:21 +01:00
2023-02-14 11:15:24 +01:00
2023-01-29 18:04:48 +03:00

Webstudio Builder

Webstudio Builder is a NoCode Visual Tool inspired by Webflow. It is the place where you can build your site or app visually.

Contributing

Don't hesitate to reach out of you have questions around contributing to the project.

Contributing guide

Community

Twitter

Discussions

Discord

Languages
TypeScript 98.9%
PLpgSQL 0.5%
CSS 0.3%
Shell 0.2%
JavaScript 0.1%