Skip to content

Commit

Permalink
chore: remove capsize workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
edu-stx committed Nov 10, 2022
1 parent d92f98c commit a7e8cf4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 30 deletions.
42 changes: 13 additions & 29 deletions src/app/components/typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,35 +96,19 @@ const titleStyles = (as: Headings) => {
}
};

interface TitleProps extends BoxProps {
/** Removes ::before pseudoelement inserted by capsize */
removeBeforePseudoElement?: boolean;
}
export const Title = forwardRefWithAs<TitleProps, Headings>(
({ removeBeforePseudoElement, ...restProps }, ref) => {
// This is to prevent tall graphemes (like emojis, some chinese characters,
// and others) getting cut off by pseudoelements inserted by capsize, which
// is due for removal:
// https://github.com/hirosystems/stacks-wallet-web/issues/2344
const styleObject = removeBeforePseudoElement
? { ...titleStyles(restProps.as), ['::before']: undefined }
: titleStyles(restProps.as);

return (
<BaseText
userSelect="none"
letterSpacing="-0.01em"
fontFamily="'Open Sauce One'"
fontWeight="500"
color={color('text-title')}
ref={ref}
display="block"
css={styleObject}
{...restProps}
/>
);
}
);
export const Title = forwardRefWithAs<BoxProps, Headings>((props, ref) => (
<BaseText
userSelect="none"
letterSpacing="-0.01em"
fontFamily="'Open Sauce One'"
fontWeight="500"
color={color('text-title')}
ref={ref}
display="block"
css={titleStyles(props.as)}
{...props}
/>
));

export const Text = forwardRefWithAs<BoxProps, 'span'>((props, ref) => (
<BaseText
Expand Down
1 change: 0 additions & 1 deletion src/app/features/current-account/current-account-name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function AccountNameTitle(props: BoxProps) {
fontSize={4}
fontWeight={500}
lineHeight="1rem"
removeBeforePseudoElement
{...props}
/>
);
Expand Down

0 comments on commit a7e8cf4

Please sign in to comment.