Skip to content

Add typography component with story #9

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add typography component with story #9

wants to merge 3 commits into from

Conversation

skyflaren
Copy link

No description provided.

Copy link

Thanks for contributing!
It looks like you haven't updated this package's version in package.json.
Please update the package version according to semantic versioning guidelines.

Copy link
Member

@SheepTester SheepTester left a comment

Choose a reason for hiding this comment

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

Looks good but I think we should be able to set the accessible heading level independently of variant

Copy link
Member

Choose a reason for hiding this comment

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

I like that the font sizes are handled with classes and media queries. Could font-size and line-height be changed to be in terms of rem? That way, if someone 🧓 has an increased font size for accessibility reasons, the text will be scaled up for them.

type Variant = 'displayName' | 'display1' | 'display2' | 'title1' | 'title2' | 'title3' |
'bodyLarge' | 'bodyMedium' | 'bodySmall' | 'cardTitle' | 'cardBody' | 'cardTags';

type ComponentType = 'p' | 'span' | 'div';
Copy link
Member

Choose a reason for hiding this comment

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

Should probably add h1 to h6 here

// As determined by: https://www.figma.com/design/9iQV86DfnonmL01vyEFqxq/Design-System-v2?node-id=19-2&t=3DSRR1vIg0O9KvWe-1
// @param props
// @param props.variant - variant as specified by Diamond Design System, e.g. display name, card title, etc.
// @param props.component - the actual semantic element, e.g. `h1`, `p`, `div` — overriden by props.variant if h1-6
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the variant should dictate the semantic element to use; it should be the other way around. For example, if they skip heading levels in the design, we need to make sure that heading levels aren't skipped in the HTML. Or if they use (H4) Title 1 for the title of the page, we should be able to use <h1> for that.

Copy link

PR Preview Action v1.6.1

🚀 View preview at
https://acmucsd.github.io/components/pr-preview/pr-9/

Built to branch gh-pages at 2025-04-29 02:03 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment on lines +1 to +3
h1, h2, h3, h4, h5, h6, .bodyLarge, .bodyMedium, .bodySmall, .cardTitle, .cardBody, .cardTags {
font-family: 'DM Sans', sans-serif;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Think we need to import DM Sans or something here for it to apply, maybe check how main website does it

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.

3 participants