Commit Graph
56 Commits
Author SHA1 Message Date
Oleg Isonen f052200d07 fix: preserve CSS variable and gradient references on paste (#5716)
Preserve var() references in pasted gradient shorthand
(css-data/parse-css.ts)
When expanding shorthand properties (e.g. background), unresolved var()
tokens were lost. Now they're recovered by probing each longhand with a
placeholder, mapping which longhands the var belongs to, and restoring
it.

Fix border-(--x) Tailwind v4 syntax not recognized (tailwind.ts)
borde
2026-04-23 13:22:33 +02:00
Oleg Isonenandzehjotkah 1f4c53419d feat: Pseudo elements (#5572)
This PR replaces the limited "States" dropdown in the Style Panel with a
flexible input field that supports any CSS selector, pseudo-class, or
pseudo-element. This allows for advanced styling capabilities such as
`:has()`, `:focus-visible`, and complex combinators.

## Key Changes

### Flexible Selector Input
- Replaced the fixed "States" category list with a free-form input
field.
- Supports **any** valid CSS selector (e.g., `:hover`, `::before`,
`:has(:checked)`).
- Validation logic ensures only valid selectors are accepted (triggered
on `Enter` key).

## How to Test
1. Select an element and open the Style Panel.
2. Click on the Local style source or a Token.
3. In the input field (bottom of menu), type a selector like `:hover` or
`:first-child` and press Enter.
4. Verify the selector is added and selected.

---------

Co-authored-by: zehjotkah <111518041+zehjotkah@users.noreply.github.com>
2026-01-19 17:28:47 +01:00
Bogdan Chadkin 4abb7cf3e2 feat: support svg properties in style panel (#5332)
Ref https://github.com/webstudio-is/webstudio/issues/5258

Newer mdn-data contains all stylable svg properties (they finally got
through some documentation and implementation process).

Tweaked all experimental stuff and ditched obsolete properties.

<img width="286" height="538" alt="image"
src="https://github.com/user-attachments/assets/1e579be0-0a12-4013-ab04-09d5e008aeed"
/>
2025-07-18 18:04:26 +02:00
Bogdan Chadkin 5637e71287 refactor: migrate css-data to hyphenated properties (#5031)
All parsers/generators accept and produce hyphenated css property. Camel
case is only used for StyleProperty type.
2025-03-22 22:38:59 +07:00
Bogdan Chadkin af653fa002 refactor: hyphenate keyword values (#4987)
Regenerated keyword values data with hyphenated properties. Since the
new object is strictly typed we can use it directly without
styleConfigByName utility which I removed.
2025-03-13 22:44:57 +07:00
Bogdan Chadkin 3c8ac56c39 refactor: migrate properties data to hyphen case (#4970)
properties data are now more type safe and can accept any CssProperty
name though in case of custom properties (--string) will return
undefined.

This also removes a lot of `keyof typeof properties` castings.
2025-03-08 20:26:40 +07:00
Oleg Isonen 7b01153f67 experimental: Shorthands autocomplete (#4898)
ref https://github.com/webstudio-is/webstudio/issues/4816

## Description

Shows shorthands in autocomplete when adding properties.

## Steps for reproduction

1. click button
2. expect xyz

## 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

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2025-02-26 16:45:20 +01:00
Bogdan Chadkin 78a0fa98c1 refactor: output hyphenated properties from css parser (#4900)
We are going to switch to hyphenated properties in styles. Here
refactored css parser to output hyphenated property instead of camel
case and added camelCaseProperty utility which does the opposite of
hyphenateProperty.
2025-02-22 18:11:57 +07:00
Bogdan Chadkin adadbe3aa2 refactor: enable isolated declatations in css data (#4476)
Moved transition related stuff into builder, simplified mdn-data and
added missing types to exports, removed popularity index.
2024-11-30 16:47:26 +07:00
Jaya Krishna Namburu d1bd5df4e1 feat: add links to mdn documentation inside tooltips for sections and properties (#4416)
## Description

fixes #4383 
Tweaked the `__generated__/properties.ts` that is generated at build
time to store `mdn_url` in it. And use these url's to show on the
tooltips for the properties and sections.

## Steps for reproduction
- Open any property, and the tooltip opens
- Inside the tooltip, you should be able to click on the external link
icon.
- The link should take you to a mdn link of the same.


![external-links](https://github.com/user-attachments/assets/9b81d2da-7d5f-4d7f-abdb-e0eaa5902a14)


## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
 
## Before requesting a review

- [x] made a self-review

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
2024-11-15 10:20:55 +05:30
Bogdan Chadkin 8d7cf574fc fix: generate text-wrap-style: auto (#4321)
Fixes https://github.com/webstudio-is/webstudio/issues/4218

Turned out text-wrap-style got removed but supported alternative
text-wrap: wrap was not generated instead.
Now all should work.

Also removed invalid text-wrap-mode: auto
2024-10-20 11:50:41 +03:00
Bogdan Chadkin 84250f4cd8 experimental: add :root support (#4175)
Ref https://github.com/webstudio-is/webstudio/issues/3399

Now we have a way to change rem and define global css variables

- show root node in navigator behind flag
- show style panel when root is selected
- inherit styles from root
- show advanced styles defined on root in descendents
- show browser styles for root (`html { display: block }`)
- show initial values instead of `inherit` in root typography
- render root styles on canvas
- property label shows root as the source

Note: generated sites are not supported yet
<img width="825" alt="Screenshot 2024-09-27 at 19 24 41"
src="https://github.com/user-attachments/assets/4c17f86a-74d8-4518-8145-854dbdbee11a">

<img width="1304" alt="Screenshot 2024-09-27 at 19 09 51"
src="https://github.com/user-attachments/assets/6003fd49-5ecb-46cd-9df7-85c571f82e32">
2024-09-28 13:01:43 +02:00
Bogdan Chadkin c81b3d502f experimental: add css custom properties support to advanced styles (#4117)
Ref https://github.com/webstudio-is/webstudio/issues/3399

- added custom properties autocomplete in advanced styles
- fixed unit value detecting to not break var()
- show inherited custom properties in advanced styles
- dropped "types" from properties meta
- parse not top level var(), for example inside layers or function as
unparsed for now

<img width="239" alt="image"
src="https://github.com/user-attachments/assets/640690d4-a52e-43a4-a3a2-6032d30c600f">
<img width="871" alt="Screenshot 2024-09-12 at 21 53 38"
src="https://github.com/user-attachments/assets/f50e52a6-1307-4554-9ee2-cb2f20dd0e2c">
<img width="862" alt="Screenshot 2024-09-12 at 21 53 47"
src="https://github.com/user-attachments/assets/09788e29-df58-41ee-a96e-c28c4006dabb">
2024-09-14 01:37:10 +02:00
Jaya Krishna Namburu e5ec6a1475 feat: add offset-position and offset-anchor properties under advanced section (#3970)
fixes #3963 

## Description
Adds `offset-position` property to be available under the advanced
section. Of all the `offset-*` properties. Looks like only `position` is
marked as experimental in `mdn-data`. But, according to can-i-use. It
seems it has a fair amount of support among browsers.
https://caniuse.com/mdn-css_properties_offset-position
![Screenshot 2024-08-20 at 11 44
59 AM](https://github.com/user-attachments/assets/ab080a22-4e94-453a-8587-38be95cc83dc)


## Steps for reproduction
- Add `offset-position` property under the advanced tab.
- check for description of the property.
- Ability to reset the property from the advanced tab.

## Code Review

- [ ] hi @TrySound , 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
- [ ] 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)
2024-08-21 13:05:10 +02:00
Bogdan Chadkin 2af8d57b8e experimental: support transition-behavior property (#3650)
This is the new property and not supported by csstree out of the box. So
we try to parse it manually. Fixes a few invalid in webflow preset.
2024-06-30 15:15:11 +03:00
Bogdan Chadkin 009c5d8e2d experimental: parse non-standard properties (#3648)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Fixed parsing non-standard properties with prefixes

- font-smoothing
- -webkit-font-smoothing
- -moz-osx-font-smoothing
- tap-highlight-color
- -webkit-tap-highlight-color
- -webkit-overflow-scrolling
2024-06-30 02:25:18 +03:00
Bogdan Chadkin 87210fa069 feat: expand backgound-position shorthand (#3646)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Here replaced shorthand background-position with
background-position-x and background-position-y

Added shorthand expander, migration and merger
for css engine to improve browser support for offsets.
2024-06-29 13:43:37 +03:00
Bogdan Chadkin a7676c5042 feat: support -webkit-line-clamp (#3640)
Ref https://github.com/webstudio-is/webstudio/issues/2647 Closes
https://github.com/webstudio-is/webstudio/issues/3427

Here added -webkit-line-clamp and -webkit-box-orient properties support
which is the only way to add multiline truncation at the moment.

All properties with prefixes are stored without camel casing. With font
smoothing as the only exception because added very early.

<img width="911" alt="Screenshot 2024-06-28 at 17 48 08"
src="https://github.com/webstudio-is/webstudio/assets/5635476/ca773cf0-81f0-47d7-97c8-5f78751332d4">
2024-06-28 20:13:19 +03:00
Oleg Isonen 853c0f7d48 experimental: Paste from webflow 11 (#3623)
## Description

- support pseudo states
- support pseudo elements

## Steps for reproduction

1. click button
2. expect xyz

## 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

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-06-27 14:35:14 +02:00
Bogdan Chadkin 6ec8aaeeb7 feat: support text-wrap (#3620)
Here revamped white-space and added support for text-wrap. Basically
both expands into

- white-space-collapse
- text-wrap-mode
- text-wrap-style

And then for better browser support all of them are merged in final css.

<img width="256" alt="Screenshot 2024-06-26 at 13 00 14"
src="https://github.com/webstudio-is/webstudio/assets/5635476/288de3c3-b045-4745-a9f0-34d97e97c0e9">
<img width="358" alt="Screenshot 2024-06-26 at 12 51 13"
src="https://github.com/webstudio-is/webstudio/assets/5635476/e2826389-0e00-443a-b402-e7890df4a02a">
2024-06-26 17:55:00 +03:00
Jaya Krishna Namburu 931e571081 refactor: drop parseTransition shorthand and add migration for transition shorthand (#3607)
fixes #3593 
## Description

This PR
- drops the `parseTransition` for parsing shorthand transition property.
- allows migration of existing transition property to long-hands.
- drops parsing `transition` when added from advanced tab. Because if we
parse and add it as proper layers. It will get remigrated again every
time the app is loaded.
- Adds tests for parsing individual transition properties and even
parses timing functions as timing functions now.


- [x] there is a bug associated with expanding transitions from
shorthands #3608 . Once fixed we need to test the new `FunctionValue`
parsing behaviour.

## Steps for reproduction

- Any previous values of `transitions` should we migrated into new
approach and should be available in the style-panel for using them.

## 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

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-06-26 06:53:05 +02:00
Bogdan Chadkin 9e23dc9580 feat: switch to overflow longhands (#3588)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Here refactored overflow UI to update "overflow-x" and "overflow-y"
longhands instead of "overflow" shorthand.

Removed "overflow" from advanced panel suggestions.

Added support for expanding overflow shorthand for webflow copy paste.

And implemented very basic migrations utility
which always run after data is loaded from server
and sends patch for expanding overflow longhands.
Patch is not sent when no properties are modified. Though eventually we
will need to support versioning to avoid executing old migrations.

<img width="279" alt="Screenshot 2024-06-18 at 19 33 21"
src="https://github.com/webstudio-is/webstudio/assets/5635476/ce44385e-3316-4e34-bc9c-5f790cbdcd4f">
2024-06-20 11:51:00 +03:00
Bogdan Chadkin 126fe3d66a experimental: expand font variant and synthesis shorthands (#3580)
Ref https://github.com/webstudio-is/webstudio/issues/2647
2024-06-18 17:51:26 +03:00
Bogdan Chadkin dfc216723a refactor: upgrade mdn-data (#3578)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Here upgraded to the latest mdn data and improved properties detection.
Excluded experimental and undocumented css properties.

- font-synthesis got longhands in mdn data
- background-position-x/y got excluded as experimental (though support
is good) but we anyway write as shorthand
- excluded white-space-collapse, text-wrap and text-wrap-* until decide
how to maintain them in the future
- field-sizing and zoom are new additions
2024-06-17 14:35:38 +03:00
Oleg Isonen 9b08f1dbbc fix: Properties like animation-name were receiving unneeded px suffix (#3543)
Closes https://github.com/webstudio-is/webstudio/issues/3529

## Description

Values that can have custom identifiers (user defined string) were
tested to accept a unit value and they did, because anything is valid.

Now they are not tested with units any more

## Steps for reproduction

1. add animation-name in advanced panel
2. use any name it should stay as-is
3. previously we would add a "px"

## 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

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-06-12 19:41:01 +02:00
Bogdan Chadkin eb2e397d0a build: drop eslint-plugin-import (#3333)
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.
2024-05-09 18:53:35 +04:00
Oleg Isonen 2c24e1f478 chore: Improved descriptions prompt and descriptions (#3186)
## Description

Bringing the changes from
https://github.com/webstudio-is/webstudio/pull/3166 as a separate PR

## Steps for reproduction

1. click button
2. expect xyz

## 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

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2024-04-17 11:13:43 +02:00
Oleg Isonen 6887463746 feat: Scrub improvements (#2904)
## Description

1. Allow scrub on any css value that can be numeric, no matter what
current keyword value might be selected
2. Adjust scrub speed depending on the unit

## Steps for reproduction

1. try scrubing any css value 
3. backdrop fill in the effects section won't allow to scrub , which is
correct
4. try changing dfferent units and see how it feels, if the speed is
appropriate

## Code Review

- [ ] hi @istarkov , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview
  

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2024-02-13 20:12:09 +01:00
Jaya Krishna Namburu f1adb0e426 feat: Add UI element to control transition property. (#2538)
Adds `transition-property` UI
2023-11-05 12:47:44 +01:00
Jaya Krishna Namburu 60a6a7fbf2 feat: Add css transitions (#2511)
## Description

Adds support for `css-transitions` when users are in `local` state. In
any other state than local, the CRUD operations on transitions are
disabled.
2023-11-01 18:36:08 +01:00
Bogdan Chadkin f08fe859bb refactor: bump change-case (#2428)
Ref https://github.com/blakeembrey/change-case/releases

Change case in last major merged many packages into one to simplify
maintaining and usage. A few packages like title-case are still separate
as more rare case.

- replaced no-case with change-case (merged into change-case)
- replaced param-case with change-case (merged into change-case and
renamed to kebab (finally))
- replaced camelcase with change-case (has own camelcase utility)
- bumped title-case
2023-10-08 01:03:59 +04:00
Bogdan Chadkin 87e69b2e85 Move style schema into css-engine (#2251)
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
```
2023-09-06 15:55:41 +04:00
Bogdan Chadkin 7f53be7b2d Add list item section to style panel (#2077)
Fix https://github.com/webstudio-is/webstudio-builder/pull/2063
https://github.com/webstudio-is/webstudio-builder/issues/2079
https://github.com/webstudio-is/webstudio-builder/issues/2060

Here added new "List Item" section specifically for List and ListItem
components. Now user can cutomize list item markers for whole list or
per each item.

Changed behavior of Select Control to put current value into the list of
options if not present. This way display shows "List Item" instead of
nothing.
2023-08-09 22:58:50 +04:00
Oleg Isonen 57417c7a58 Add font smoothing by default to the body (#1972)
## Description

Adding font smoothing by default to the Body component


https://discord.com/channels/955905230107738152/955907787299360788/1132882679189229649

```
  -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
```

## Steps for reproduction

1. open any project, see in dev tools these 2 added (or check visually)

## Code Review

- [ ] hi @istarkov , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

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

## Before merging

- [ ] 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
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-07-25 12:38:58 +02:00
Bogdan Chadkin 5be5abf8b3 Replace minimist with parseArgs (#1868)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1191
2023-06-28 23:22:33 +03:00
Bogdan Chadkin c5f84b7822 Run eslint from the root with cache (#1854)
While turborepo does not work for us we can try to solve long checks
time with builtin caching. Eslint provides similar one to prettier we
already use.

```
pnpm -r lint
51.53s

pnpm eslint . --ext .ts,.tsx --max-warnings 0
18.10s

pnpm eslint . --ext .ts,.tsx --max-warnings 0 --cache (with cache)
1.82s
```

In this PR I removed all lint scripts in packages and added global one
in the to github workflow. It saves like 30s on my laptop because pnpm.
Already stored cache makes linting almost instant.

Also bumped all eslint dependencies.
2023-06-26 10:08:15 +03:00
Bogdan Chadkin 43868bfbc0 Fix text-align control default value (#1822)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1794

Here fixed initial value in css data. Mdn provides unclear value because
of legacy browsers. Here we need to override it with actual "start".
2023-06-19 17:50:36 +03:00
Bogdan Chadkin 1be61e59bb Compute currentColor (#1815)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1536

Here replaced browser getComputedStyle for currentColor with computing
from data.

`color: inherit` is now considered same as `color: currentColor` and
displayed properly in UI.

Changed initial value for color from inherit to black (in mdn-data it's
canvastext).
2023-06-19 16:27:27 +03:00
Bogdan Chadkin fd8ac62296 Drop deprecated system colors (#1758)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1301

## 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

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

## Before merging

- [ ] 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
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-06-12 17:11:11 +02:00
Giuseppe 6a9c4c013c Initial CSS parser (#1652)
## Description

This PR moves the parse-css-value utility that was before part of the
builder app to the css-data package.

In this package we are adding an initial `parse-css` utility that will take
CSS and convert to a format that we can work on within Webstudio. For
now it is relatively simple and it supports only CSS classes parsing.
2023-05-23 09:47:13 +02:00
Bogdan Chadkin 9d0285f56b Support bold and normal font-weight (#1641)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1535

Here instead of hacky preconverting to numeric font-weight value support
"normal" and "bold" as input for font weight control.

Defaults can be checked on h1 and body.
2023-05-20 10:32:49 +07:00
Oleg IsonenandJayaKrishnaNamburu b4b86a6c89 Outline style property (#1630)
## Description

https://github.com/webstudio-is/webstudio-builder/pull/1596

---------

Co-authored-by: JayaKrishnaNamburu <namburu1995@gmail.com>
2023-05-14 18:40:12 +02:00
Bogdan Chadkin 403edf6523 Parse tuple in css-data (#1548)
We support tuple type in styles and can now parse initial values
properly which is important since we no longer use computed browser
style.
2023-05-03 01:00:37 +08:00
Bogdan Chadkin c60ee0af07 Show initial and html style in style panel (#1533)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1067

We need to move away from getComputedStyle for not local styles in style
panel.

Here added default html style from browser sources. Now we can render it
and properties initial styles instead of computed styles.

Also fixed in properties data generation currentcolor -> currentColor
and removed same from border presets.
2023-04-27 17:06:38 +07:00
Ivan Starkov 8bf079d821 Add common keywords (#1385)
## Description

closes #1378

## Steps for reproduction

Take any css property, see it contains 
initial, inherit, unset

## 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

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

## Before merging

- [ ] 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
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-04-06 22:21:52 +04:00
Ivan Starkov d3fe478953 Backgrounds, part 2 (#1201)
## Description

Backgrounds part 2. ref #877

- [x] - remove repeat section under gradient part
- [x] - info Icon for gradient "code"

The floating panel, gradients support.

<img width="508" alt="image"
src="https://user-images.githubusercontent.com/5077042/224417159-22a27ffd-6460-4d97-8891-f14a9a3331a3.png">

No drag, no hide, no smart insert



## Steps for reproduction

1. click button
2. expect xyz

## 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

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

## Before merging

- [ ] 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
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-03-11 19:36:48 +04:00
Oleg Isonen 77b8dab455 Support background-clip text (#1123)
## Description

There are multiple problems with clipping to text:
1. it is only supported with vendor prefixed -webkit-background-clip
2. it doesn't work with CSS vars (not using them on canvas for this)


## Steps for reproduction

1. add heading
4. set background image src to some image
5. set color to transparent
6. set background-clip to text
7. Background image should be clipped to text

<img width="294" alt="Screenshot 2023-02-24 at 13 49 22"
src="https://user-images.githubusercontent.com/52824/221194656-9e4591ed-5727-45f0-8560-eba35e278819.png">


## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] 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
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-02-24 18:21:10 +01:00
Bogdan Chadkin 5fe9364cb1 Improve units in style panel (#735)
Ref https://github.com/webstudio-is/webstudio-designer/issues/366

- generate grouped units for non length values
- show unit select when initial unitless

So we get all 3 points from the issue

- all properties has only supported units
- hidden but supported units still can be entered
- unsupported values are validated

<img width="243" alt="Screenshot 2023-01-04 at 14 12 29"
src="https://user-images.githubusercontent.com/5635476/210546684-ca696096-f78c-445f-bbc3-04db7326239b.png">
<img width="224" alt="Screenshot 2023-01-04 at 14 14 54"
src="https://user-images.githubusercontent.com/5635476/210546689-396c7d42-e6f0-42a9-869c-7b231baa3d71.png">
2023-01-04 18:20:15 +03:00
Bogdan Chadkin cdba1c7149 Fix unitless initial values (#734)
Ref https://github.com/webstudio-is/webstudio-designer/issues/366

There were many unitless initial values with "px" unit. Here I extracted
all possible unit types from properties syntaxes. csstree provides a
list of unit groups which in the future will let us provide correct list
of units for css value input.
2023-01-04 13:57:54 +03:00
Bogdan Chadkin 81194d8422 Remove incorrect keywords from generated data (#730)
While fixing units found a lot of keywords appear from css functions
which are complex values and should be ignored. So here I changed
traversing of properties syntaxes to support only top level values and
keywords.

Mostly gone color words

```diff
-6639 lines  116 KB
+4808 lines  85.8 KB
```

See diff for more info
2023-01-03 23:23:04 +03:00