Skip to content

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.

limit the units

Oleg Isonenf7a647abb45d
diff --git a/apps/designer/app/designer/features/style-panel/shared/css-value-input/css-value-input.tsx b/apps/designer/app/designer/features/style-panel/shared/css-value-input/css-value-input.tsx
index 931a1186e2..aa226aaf9f 100644
--- a/apps/designer/app/designer/features/style-panel/shared/css-value-input/css-value-input.tsx
+++ b/apps/designer/app/designer/features/style-panel/shared/css-value-input/css-value-input.tsx
@@ -19,7 +19,6 @@ import {
type UnitValue,
type UnsetValue,
StyleValue,
- units as unsortedUnits,
} from "@webstudio-is/react-sdk";
import {
type KeyboardEventHandler,
@@ -29,12 +28,16 @@ import {
useState,
} from "react";
-// @todo sorting doesn't work
-export const defaultUnits: Array<Unit> = [...unsortedUnits].sort((unit) =>
- ["px", "%", "em", "rem", "ch", "vw", "vh", "vmin", "vmax"].includes(unit)
- ? -1
- : 1
-);
+export const defaultUnits: Array<Unit> = [
+ "px",
+ "em",
+ "rem",
+ "ch",
+ "vw",
+ "vh",
+ "%",
+ "number",
+];
const defaultKeywords: [] = [];
const defaultValue: UnsetValue = { type: "unset", value: "" };