Skip to content

Typography component#60

Merged
kaja-osojnik merged 1 commit into
masterfrom
kaja/typography-component
Aug 28, 2025
Merged

Typography component#60
kaja-osojnik merged 1 commit into
masterfrom
kaja/typography-component

Conversation

@kaja-osojnik
Copy link
Copy Markdown
Contributor

Add Typography component with variants for headings, paragraph, muted, blockquote and size.

@kaja-osojnik kaja-osojnik requested a review from buberdds August 26, 2025 12:45
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 26, 2025

Deployed to Cloudflare Pages

Latest commit: 478ded3d9976d0796b3372c15c7c9f38246556f7
Status:✅ Deploy successful!
Preview URL: https://1ef2c323.oasis-ui.pages.dev
Alias: https://pr-60.oasis-ui.pages.dev

@kaja-osojnik kaja-osojnik force-pushed the kaja/typography-component branch from 106025d to 6ebf66c Compare August 26, 2025 15:57
Comment thread src/components/typography/index.tsx Outdated
Comment thread src/components/typography/index.tsx Outdated
Comment thread src/components/typography/index.tsx Outdated
Comment thread src/components/typography/index.tsx Outdated
export const typographyVariants = cva("", {
variants: {
variant: {
h1: "scroll-m-20 text-4xl font-semibold tracking-[-0.04em] lg:text-5xl",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's up with tracking-[-0.04em] why do we even care about it ? I also don't see such value in a design guide.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This are styles from Figma shadcn design system library directly - under 'letter-spacing'. Will confirm with design team, what needs to be used.

Comment thread src/components/typography/index.tsx Outdated
lead: "text-xl text-muted-foreground",
large: "text-lg font-semibold",
small: "text-sm font-medium leading-none",
muted: "text-sm text-muted-foreground",
Copy link
Copy Markdown
Collaborator

@buberdds buberdds Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does muted should force text size? Yeah I think it's better to make muted another prop in cva like textColor (this name is not ideal, but I am using it in Link already) so it can be applied to any element with variant combo. Should small large be size?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure - this is also taken directly from shadcn default component, but happy to remove if we need more freedom to be using it for larger text sizes as well.

Comment thread src/components/typography/index.tsx Outdated
h2: "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-[-0.04em] first:mt-0",
h3: "scroll-m-20 text-2xl font-semibold tracking-[-0.04em]",
h4: "scroll-m-20 text-xl font-semibold tracking-[-0.04em]",
p: "leading-7 [&:not(:first-child)]:mt-6",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is changing line-height for p safe? will this always align nicely with copy in other HTML elements?
How this mt-6 is working? Shouldn't this be handled by container's gap in most cases ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean - again these were default shadcn values from the library, but seems like it needed to be adjusted as how is used in Explorer. Will discuss with design team.

@buberdds
Copy link
Copy Markdown
Collaborator

buberdds commented Aug 27, 2025

why Storybook renders class prop ? I would assume it will auto filter it out, anyway this is important for now

@kaja-osojnik kaja-osojnik force-pushed the kaja/typography-component branch from 6ebf66c to 912664e Compare August 27, 2025 11:36
@kaja-osojnik kaja-osojnik self-assigned this Aug 27, 2025
@kaja-osojnik kaja-osojnik force-pushed the kaja/typography-component branch 2 times, most recently from 6a0c407 to 400d217 Compare August 27, 2025 21:26
@kaja-osojnik kaja-osojnik force-pushed the kaja/typography-component branch from 400d217 to 478ded3 Compare August 28, 2025 08:52
@kaja-osojnik kaja-osojnik merged commit 9c7702d into master Aug 28, 2025
4 checks passed
@kaja-osojnik kaja-osojnik deleted the kaja/typography-component branch August 28, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants