Skip to content

Commit

Permalink
remove double lines
Browse files Browse the repository at this point in the history
  • Loading branch information
indaviande committed Dec 17, 2024
1 parent b24e0ac commit c5c71fa
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions src/components/primitives/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export const textStyles = tv(
md: "text-base",
lg: "text-lg",
xl: "text-xl",
display1: "font-title font-bold leading-tight italic uppercase !text-[clamp(44px,5vw+0.875rem,104px)]",
display1:
"font-title font-bold leading-tight italic uppercase !text-[clamp(44px,5vw+0.875rem,104px)]",
1: "font-title font-bold italic leading-none !text-[clamp(44px,4.333vw+1.125rem,96px)]",
2: "font-title font-bold leading-none italic !text-[clamp(38px,0.667vw+2.125rem,46px)]",
3: "font-title font-bold leading-none italic !text-[clamp(26px,0.667vw+1.375rem,34px)]",
Expand All @@ -32,35 +33,37 @@ export const textStyles = tv(
false: "",
},
},
size: {
xs: "text-xs",
sm: "text-sm",
md: "text-base",
lg: "text-lg",
xl: "text-xl",
display1: "font-title font-bold leading-tight italic uppercase !text-[clamp(44px,5vw+0.875rem,104px)]",
1: "font-title !text-3xl",
2: "font-title font-bold leading-none italic !text-[clamp(38px,0.667vw+2.125rem,46px)]",
3: "font-title font-bold leading-none italic !text-[clamp(26px,0.667vw+1.375rem,34px)]",
4: "font-title font-bold leading-[1.18] !text-[clamp(18px,0.667vw+0.875rem,26px)]",
5: "font-title font-bold leading-none !text-[clamp(15px,0.25vw+0.84375rem,18px)] uppercase tracking-[0.8px] ",
6: "font-title !text-sm",
},
interactable: {
true: "cursor-pointer select-none",
false: "",
},
defaultVariants: {
look: "base",
size: "md",
},
},
{ twMerge: false },
{ twMerge: false }
);

export type TextProps = Component<Styled<typeof textStyles> & { bold?: boolean }, HTMLParagraphElement>;
export type TextProps = Component<
Styled<typeof textStyles> & { bold?: boolean },
HTMLParagraphElement
>;

export default function Text({ look, size, style, bold, interactable, className, ...props }: TextProps) {
export default function Text({
look,
size,
style,
bold,
interactable,
className,
...props
}: TextProps) {
const styleBold = bold ? "font-bold" : "";
return <p className={mergeClass(textStyles({ look, size, interactable }), styleBold, className)} {...props} />;
return (
<p
className={mergeClass(
textStyles({ look, size, interactable }),
styleBold,
className
)}
{...props}
/>
);
}

0 comments on commit c5c71fa

Please sign in to comment.