Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Typography): new semi-bold variant #1439

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/react-components/src/components/Typography/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ interface IProps extends React.HTMLAttributes<HTMLElement> {
uppercase?: boolean;
/** Optional prop to set the bold */
bold?: boolean;
/** Optional prop to set the semi-bold */
semiBold?: boolean;
/** Optional prop to set the underline */
underline?: boolean;
/** Optional prop to set the strike */
Expand All @@ -40,6 +42,7 @@ export const Text: React.FC<React.PropsWithChildren<IProps>> = ({
caps = false,
uppercase = false,
bold = false,
semiBold = false,
underline = false,
strike = false,
children,
Expand All @@ -57,6 +60,7 @@ export const Text: React.FC<React.PropsWithChildren<IProps>> = ({
className: cx(
{
[styles[`${baseClassPrefix}-${size}`]]: true,
[styles[`${baseClassPrefix}--semi-bold`]]: semiBold,
marcinsawicki marked this conversation as resolved.
Show resolved Hide resolved
[styles[`${baseClassPrefix}--bold`]]: bold,
[styles[`${baseClassPrefix}--strike`]]: strike,
[styles[`${baseClassPrefix}--underline`]]: underline,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@
}

.paragraph {
&--semi-bold {
font-weight: 500;
}

&--bold {
font-weight: 600;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export const TextExamples: React.FC = () => {
<Text size={size} bold>
Paragraph {size.toUpperCase()} with bold
</Text>
<Text size={size} semiBold>
Paragraph {size.toUpperCase()} with semi-bold
</Text>
<Text size={size} underline>
Paragraph {size.toUpperCase()} with underline
</Text>
Expand Down
Loading