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.

fix unit font

Oleg Isonen74876bd9ad34
diff --git a/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx b/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx
index 6012a7dfc0..d5046b8313 100644
--- a/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx
+++ b/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx
@@ -10,6 +10,7 @@ import {
SelectItem,
SelectContent,
TextFieldIconButton,
+ Text,
} from "@webstudio-is/design-system";
import { ChevronDownIcon, ChevronUpIcon } from "@webstudio-is/icons";
import { isValid } from "../parse-css-value";
@@ -90,9 +91,13 @@ export const useUnitSelect = ({
return [isOpen, select];
};
-const StyledTrigger = styled(TextFieldIconButton, {
- px: 3,
-});
+const StyledTrigger = ({ children }: { children: JSX.Element }) => {
+ return (
+ <TextFieldIconButton css={{ px: "$spacing$2" }}>
+ <Text variant="unit">{children}</Text>
+ </TextFieldIconButton>
+ );
+};
type UnitSelectProps = {
options: Array<string>;
diff --git a/packages/design-system/src/components/text-field.tsx b/packages/design-system/src/components/text-field.tsx
index ef93cb08f8..9b9dfb1f22 100644
--- a/packages/design-system/src/components/text-field.tsx
+++ b/packages/design-system/src/components/text-field.tsx
@@ -37,6 +37,12 @@ export const TextFieldIconButton = styled(
"button",
{
border: "none",
+ boxSizing: "border-box",
+ fontFamily: "inherit",
+ fontSize: "inherit",
+ color: "inherit",
+ padding: 0,
+ margin: 0,
"&:hover": {
backgroundColor: "$slate7",
color: "$hiContrast",