webstudio-is / webstudio

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
https://webstudio.is
GNU Affero General Public License v3.0
4.85k stars 570 forks source link

Animation name property value adds px unit automatically #3529

Closed kof closed 4 months ago

kof commented 4 months ago

Steps

  1. add animation-name in advanced section
  2. type any value, e.g. slideup
  3. see builder adding "px" automatically and turning it into "slideuppx"
kof commented 4 months ago

Turns out our logic is trynig to prase the value with a unit and in this case its also a valid value, so is any other value that can have an arbitrary string.

 // Try value with existing or fallback unit
  const unit = "unit" in styleValue ? styleValue.unit ?? "px" : "px";
  let styleInput = parseCssValue(property, `${value}${unit}`);