-
Notifications
You must be signed in to change notification settings - Fork 71
feat(eds-demo): 💄 Implement Typography System #4009
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
base: develop
Are you sure you want to change the base?
Conversation
e8f6853
to
c294ddd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the EDS 2.0 typography system using a CSS data-attribute driven approach with space toggle techniques for conditional styling. The implementation provides comprehensive typography scaling from xs
(10.5px) to 6xl
(37px) with baseline grid alignment and ratio-based padding calculations for optical alignment.
- Typography system with full scale support and baseline alignment
- Data-attribute driven sizing system using CSS custom properties
- Component updates to use the new Typography component across the demo app
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/eds-demo/src/app/typography.css | New comprehensive CSS typography system with data-attribute driven sizing |
packages/eds-demo/src/app/globals.css | Import typography CSS and update base styling |
packages/eds-demo/src/app/_components/Typography.tsx | New React Typography component with preset components |
packages/eds-demo/src/app/_components/index.tsx | Remove hardcoded typography wrapper from TableHeader |
packages/eds-demo/src/app/_components/TopBar.tsx | Update to use Typography component |
packages/eds-demo/src/app/_components/DataTable.tsx | Replace hardcoded typography with Typography component |
packages/eds-demo/src/app/_components/Dashboard.tsx | Update heading to use Typography component |
packages/eds-demo/src/app/_components/Button.tsx | Update buttons to use Typography component |
packages/eds-demo/src/app/_components/ActionButton.tsx | Add Typography component usage |
packages/eds-demo/src/app/(exercise)/static/exercise/styles.module.css | Remove duplicate CSS file |
packages/eds-demo/src/app/(exercise)/dynamic/exercise/styles.module.css | Remove duplicate CSS file |
.vscode/settings.json | Add eds-demo to workspace folders |
Comments suppressed due to low confidence (1)
packages/eds-demo/src/app/_components/Typography.tsx:1
- The CSS property value should be 'cap' instead of 'ex' to match the comment on line 215 which states 'trim-both cap alphabetic'.
import { ReactNode, HTMLAttributes, CSSProperties } from "react";
0209ca6
to
4ba7d13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The styles.module.css in the static and dynamic exercise folder is used for demo/tutorial purpose and should be removed.
} | ||
|
||
// ============================================ | ||
// Preset components for common use cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome with all these preset components. This is what our users want. 🎖️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…at least Fusion and Amplify 😉 They have asked specifically for a more opinionated typography component, but I assume others would chime in as well if we ask them. We need to ensure we have the same in Figma and Code though, so I suggest you and @eddiman or @alexlvrs start looking at that @pomfrida once we get the colours out the door.
// Preset components for common use cases | ||
// ============================================ | ||
|
||
interface HeadingProps extends Omit<TypographyProps, "as"> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice interface/type using Omit from the base type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor changes required. I see that @millus has already implemented the CDN for the fonts, so no need to do anything about that.
} | ||
|
||
// ============================================ | ||
// Preset components for common use cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…at least Fusion and Amplify 😉 They have asked specifically for a more opinionated typography component, but I assume others would chime in as well if we ask them. We need to ensure we have the same in Figma and Code though, so I suggest you and @eddiman or @alexlvrs start looking at that @pomfrida once we get the colours out the door.
0cef9b1
to
1e8891c
Compare
55a542c
to
6fadb5e
Compare
9c67b23
to
3eb5207
Compare
resolves https://github.com/equinor/design-system-internal/issues/205
This PR implements the EDS 2.0 typography system based on the approach from the CodePen example (found in the task), using data-attribute driven sizing and space toggle CSS techniques.
What's Implemented
Typography Component (
Typography.tsx
)size
,lineHeight
,baselineAligned
,weight
, andas
(HTML element)xs
(10.5px) to6xl
(37px)Heading
,Body
,Caption
,Label
,Strong
Typography CSS System (
typography.css
)data-font-size
,data-line-height
,data-not-baseline-aligned
)text-box: trim-both ex alphabetic
Components Updated
Button.tsx
- PrimaryButton and SecondaryButton now use TypographyDataTable.tsx
- Table headers and cell content use TypographyTopBar.tsx
- Subtitle uses TypographyTableHeader
,Tab
) - Removed hardcoded typography wrappers to allow Typography component usageTesting Notes
Typography has been verified against Figma designs for font sizes, weights, and line heights. The space toggle system and baseline alignment features work as expected in supporting browsers.