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 small CSS issues

Sara Vieiraafc7ada9f9a5
diff --git a/apps/designer/app/designer/features/sidebar-left/lib/header.tsx b/apps/designer/app/designer/features/sidebar-left/lib/header.tsx
index 57ede21374..b10215574d 100644
--- a/apps/designer/app/designer/features/sidebar-left/lib/header.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/lib/header.tsx
@@ -34,7 +34,7 @@ export const Header = ({ title, isClosable = true, onClose }: HeaderProps) => {
</IconButton>
)}
</Flex>
- <Separator />
+ <Separator css={{ height: 2 }} />
</>
);
};
diff --git a/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-info.tsx b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-info.tsx
index b7fcf61f86..f4e9e49b1d 100644
--- a/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-info.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-info.tsx
@@ -2,8 +2,7 @@ import {
Box,
Flex,
Grid,
- Text,
- Separator,
+ __DEPRECATED__Text,
Button,
} from "@webstudio-is/design-system";
import type { Asset } from "@webstudio-is/prisma-client";
@@ -18,33 +17,40 @@ import { useSubmit } from "@remix-run/react";
import prettyBytes from "pretty-bytes";
import { Header } from "../../lib/header";
-const Filename = ({ name }: { name: string }) => (
- <Box
- css={{
- position: "relative",
- maxWidth: "70%",
- }}
- >
- <Text
- size="1"
- data-extension={name.split(".").pop()}
+const Filename = ({ name }: { name: string }) => {
+ const splitName = name.split(".");
+ const extension = splitName[splitName.length - 1];
+ const lastLetterBeforeExtension = splitName[splitName.length - 2]
+ .split("")
+ .pop();
+ return (
+ <Box
css={{
- whiteSpace: "nowrap",
- textOverflow: "ellipsis",
- overflow: "hidden",
- "&::after": {
- content: "attr(data-extension)",
- position: "absolute",
- left: "100%",
- top: 0,
- whiteSpace: "nowrap",
- },
+ position: "relative",
+ maxWidth: "70%",
}}
>
- {name}
- </Text>
- </Box>
-);
+ <__DEPRECATED__Text
+ size="1"
+ data-extension={`${lastLetterBeforeExtension}.${extension}`}
+ css={{
+ whiteSpace: "nowrap",
+ textOverflow: "ellipsis",
+ overflow: "hidden",
+ "&::after": {
+ content: "attr(data-extension)",
+ position: "absolute",
+ left: "100%",
+ top: 0,
+ whiteSpace: "nowrap",
+ },
+ }}
+ >
+ {name}
+ </__DEPRECATED__Text>
+ </Box>
+ );
+};
type AssetInfoProps = Asset & {
onClose: () => void;
@@ -73,32 +79,37 @@ export const AssetInfo = ({
return (
<>
<Header title="Asset Details" onClose={onClose} />
- <Separator />
- <Box css={{ p: "$2 $3" }}>
- <Grid columns={2} align="center">
- <Box css={{ width: 100 }}>
- <Filename name={name} />
- </Box>
- <Flex align="center" css={{ gap: "$1" }}>
- <CloudIcon />
- <Text size="1">{prettyBytes(size)}</Text>
- </Flex>
- </Grid>
- </Box>
- <Box css={{ p: "$2 $3" }}>
- <Grid columns={2}>
- <Flex align="center" css={{ gap: "$1" }}>
- <SizeIcon />
- <Text size="1">
- {width} x {height}
- </Text>
- </Flex>{" "}
- <Flex align="center" css={{ gap: "$1" }}>
- <AspectRatioIcon />
- <Text size="1">{getFormattedAspectRatio(width, height)}</Text>
- </Flex>
- </Grid>
- </Box>
+ <Grid cols="2" gap="$1">
+ <Box css={{ p: "$2 $3" }}>
+ <Grid columns={2} align="center">
+ <Box css={{ width: 100 }}>
+ <Filename name={name} />
+ </Box>
+ <Flex align="center" css={{ gap: "$1" }}>
+ <CloudIcon />
+ <__DEPRECATED__Text size="1">
+ {prettyBytes(size)}
+ </__DEPRECATED__Text>
+ </Flex>
+ </Grid>
+ </Box>
+ <Box css={{ p: "$2 $3" }}>
+ <Grid columns={2}>
+ <Flex align="center" css={{ gap: "$1" }}>
+ <SizeIcon />
+ <__DEPRECATED__Text size="1">
+ {width} x {height}
+ </__DEPRECATED__Text>
+ </Flex>{" "}
+ <Flex align="center" css={{ gap: "$1" }}>
+ <AspectRatioIcon />
+ <__DEPRECATED__Text size="1">
+ {getFormattedAspectRatio(width, height)}
+ </__DEPRECATED__Text>
+ </Flex>
+ </Grid>
+ </Box>
+ </Grid>
<Box css={{ p: "$2 $3" }}>
<Button variant="red" size="2" onClick={handleDeleteAsset}>
<Flex align="center" css={{ gap: "$1" }}>
diff --git a/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-tooltip.tsx b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-tooltip.tsx
index 7eabb24475..58ff958907 100644
--- a/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-tooltip.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-tooltip.tsx
@@ -20,7 +20,7 @@ export const AssetTooltip = ({
multiline
onEscapeKeyDown={closeTooltip}
onPointerDownOutside={closeTooltip}
- css={{ width: 240, maxWidth: 240 }}
+ css={{ width: 240, maxWidth: 240, padding: 0, paddingBottom: "$2" }}
content={
<AssetInfo
onDelete={onDelete}
diff --git a/packages/design-system/src/components/separator.tsx b/packages/design-system/src/components/separator.tsx
index f491d0c4e3..fb4c7eceb5 100644
--- a/packages/design-system/src/components/separator.tsx
+++ b/packages/design-system/src/components/separator.tsx
@@ -23,12 +23,12 @@ export const Separator = styled(SeparatorPrimitive.Root, {
},
"2": {
'&[data-orientation="horizontal"]': {
- height: "1px",
+ height: "2px",
width: "$7",
},
'&[data-orientation="vertical"]': {
- width: "1px",
+ width: "2px",
height: "$7",
},
},
diff --git a/packages/icons/src/index.ts b/packages/icons/src/index.ts
index eda66051f6..cab70530d6 100644
--- a/packages/icons/src/index.ts
+++ b/packages/icons/src/index.ts
@@ -13,3 +13,4 @@ export * from "./types";
export { AspectRatioIcon } from "./aspect-ratio";
export * from "./cloud";
export { TrashIcon } from "./trash";
+export { SizeIcon } from "./size";
diff --git a/packages/icons/src/size.tsx b/packages/icons/src/size.tsx
new file mode 100644
index 0000000000..46e892352f
--- /dev/null
+++ b/packages/icons/src/size.tsx
@@ -0,0 +1,27 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const SizeIcon = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width={16}
+ height={16}
+ viewBox="0 0 16 16"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M11.897 12.497a.6.6 0 00.6-.6V8a.6.6 0 10-1.2 0v2.449L5.55 4.702H8a.6.6 0 000-1.2H4.102a.6.6 0 00-.6.6V8a.6.6 0 001.2 0V5.55l5.747 5.747h-2.45a.6.6 0 100 1.2h3.898z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+
+SizeIcon.displayName = "SizeIcon";