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.

make size of cards readable

Sara Vieira7c83daae055d
diff --git a/app/auth/login.tsx b/app/auth/login.tsx
index b4174e5b76..d37bde959a 100644
--- a/app/auth/login.tsx
+++ b/app/auth/login.tsx
@@ -33,7 +33,7 @@ export const meta: MetaFunction = () => {
export const Login = ({ errorMessage }: { errorMessage: string }) => {
const [isDevLogin, setIsDevLogin] = useState(false);
- const loaderData = useLoaderData();
+ const data = useLoaderData();
return (
<Flex
@@ -42,9 +42,9 @@ export const Login = ({ errorMessage }: { errorMessage: string }) => {
align="center"
justify="center"
>
- <Card>
- <Flex direction="column" gap="2" align="center">
- <Heading>Login</Heading>
+ <Card size={2}>
+ <Flex direction="column" gap="4" align="center">
+ <Heading size="2">Login</Heading>
{errorMessage.length ? (
<Text css={{ textAlign: "center" }} variant="red">
{errorMessage}
@@ -53,31 +53,34 @@ export const Login = ({ errorMessage }: { errorMessage: string }) => {
<Flex gap="2" direction="column" align="center">
<Form action="/auth/github" method="post">
<Button
+ size={3}
type="submit"
- disabled={loaderData.isGithubEnabled === false}
+ disabled={data.isGithubEnabled === false}
>
<Flex gap="1">
- <GithubIcon width="16" />
+ <GithubIcon width="20" />
Login with GitHub
</Flex>
</Button>
</Form>
<Form action="/auth/google" method="post">
<Button
+ size={3}
type="submit"
- disabled={loaderData.isGoogleEnabled === false}
+ disabled={data.isGoogleEnabled === false}
>
<Flex gap="1">
- <GoogleIcon width="16" />
+ <GoogleIcon width="20" />
Login with Google
</Flex>
</Button>
</Form>
- {loaderData.isDevLogin && (
+ {data.isDevLogin && (
<>
{isDevLogin ? (
<Form action="/auth/dev" method="post">
<TextField
+ size={2}
css={{ width: "100%", flexGrow: 1 }}
name="secret"
type="text"
@@ -90,10 +93,11 @@ export const Login = ({ errorMessage }: { errorMessage: string }) => {
) : (
<Button
onClick={() => setIsDevLogin(true)}
+ size={3}
css={{ width: "100%" }}
>
<Flex gap="1" align="center">
- <CommitIcon></CommitIcon>
+ <CommitIcon width="20" />
Dev Login
</Flex>
</Button>
diff --git a/app/dashboard/components/card.tsx b/app/dashboard/components/card.tsx
index 4289f5f67b..2e42769fcf 100644
--- a/app/dashboard/components/card.tsx
+++ b/app/dashboard/components/card.tsx
@@ -35,10 +35,13 @@ export const SelectProjectCard = ({
const options = ["", ...projects.map((project) => project.id)];
return (
- <Card>
- <Flex direction="column" gap="2">
- <Heading>Select a project</Heading>
+ <Card size={2}>
+ <Flex direction="column" gap="4">
+ <Heading size="2" css={{ textAlign: "center" }}>
+ Select a project
+ </Heading>
<Select
+ size={2}
name="project"
options={options}
onChange={setSelectedProject}
@@ -53,6 +56,7 @@ export const SelectProjectCard = ({
<Form method="post">
<Flex gap="1">
<TextField
+ size={2}
state={errors ? "invalid" : undefined}
name="project"
defaultValue={newProject}
@@ -64,6 +68,7 @@ export const SelectProjectCard = ({
}}
/>
<Button
+ size={2}
disabled={
newProject.length === 0 || transition.state === "submitting"
}
@@ -79,7 +84,9 @@ export const SelectProjectCard = ({
) : null}
</Form>
) : (
- <Button onClick={handleOpen}>Open</Button>
+ <Button onClick={handleOpen} size={2}>
+ Open
+ </Button>
)}
</Flex>
</Card>
diff --git a/app/shared/design-system/components/card.tsx b/app/shared/design-system/components/card.tsx
index f971138949..317e7b8517 100644
--- a/app/shared/design-system/components/card.tsx
+++ b/app/shared/design-system/components/card.tsx
@@ -7,12 +7,9 @@ export const Card = styled("div", {
font: "inherit",
lineHeight: "1",
outline: "none",
- width: "$10",
- padding: "$5",
textAlign: "inherit",
verticalAlign: "middle",
WebkitTapHighlightColor: "rgba(0, 0, 0, 0)",
-
backgroundColor: "$panel",
display: "block",
textDecoration: "none",
@@ -35,6 +32,16 @@ export const Card = styled("div", {
},
variants: {
+ size: {
+ 1: {
+ width: "$10",
+ padding: "$5",
+ },
+ 2: {
+ width: "$12",
+ padding: "$7",
+ },
+ },
variant: {
interactive: {
"@hover": {
@@ -97,4 +104,7 @@ export const Card = styled("div", {
},
},
},
+ defaultVariants: {
+ size: "1",
+ },
});
diff --git a/app/shared/design-system/components/select.tsx b/app/shared/design-system/components/select.tsx
index 12f09ef3b8..02ab07ba04 100644
--- a/app/shared/design-system/components/select.tsx
+++ b/app/shared/design-system/components/select.tsx
@@ -14,10 +14,7 @@ const StyledTrigger = styled(SelectPrimitive.SelectTrigger, {
display: "inline-flex",
alignItems: "center",
justifyContent: "space-between",
- padding: "0 $1 0 $2",
- fontSize: "$1",
fontVariantNumeric: "tabular-nums",
- height: "$5",
gap: "$2",
flexShrink: 0,
borderRadius: "$1",
@@ -33,6 +30,10 @@ const StyledTrigger = styled(SelectPrimitive.SelectTrigger, {
},
variants: {
+ size: {
+ 1: { padding: "0 $1 0 $2", fontSize: "$1", height: "$5" },
+ 2: { padding: "0 $2 0 $3", height: "$6", fontSize: "$3" },
+ },
ghost: {
true: {
backgroundColor: "transparent",
@@ -45,6 +46,9 @@ const StyledTrigger = styled(SelectPrimitive.SelectTrigger, {
},
},
},
+ defaultVariants: {
+ size: 1,
+ },
});
const StyledIcon = styled(SelectPrimitive.Icon, {