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): add new label3 style #770

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/dev/pages/typography/typography.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<div class="section">
<div class="forge-typography--label1">Label 1</div>
<div class="forge-typography--label2">Label 2</div>
<div class="forge-typography--label3">Label 3</div>
</div>

<div class="section">
Expand Down
10 changes: 10 additions & 0 deletions src/lib/core/styles/tokens/typography/_tokens.label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ $label2: utils.inherit-map(
)
) !default;

$label3: utils.inherit-map(
core.$base,
(
font-size: type-utils.font-size-relative(label, font-size, '0875'),
line-height: type-utils.font-size-relative(label, line-height, '1250'),
letter-spacing: type-utils.calc-letter-spacing(0.125, scale.value('0875'))
)
) !default;

$button: utils.inherit-map(
core.$base,
(
Expand All @@ -45,6 +54,7 @@ $overline: utils.inherit-map(
$tokens: (
label1: $label1,
label2: $label2,
label3: $label3,
button: $button,
overline: $overline
) !default;
14 changes: 7 additions & 7 deletions src/stories/design-tokens/Typography.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ Each typography style also has its own set of tokens that define the font size,

For example, Forge will set the `<body>` element on your page to use the `body2` style by default. This style is defined by the following tokens:

| Token
| Token
| --------------------------------------------
| `--forge-typography-body2-font-family`
| `--forge-typography-body2-font-size`
| `--forge-typography-body2-font-weight`
| `--forge-typography-body2-line-height`
| `--forge-typography-body2-letter-spacing`
| `--forge-typography-body2-text-transform`
| `--forge-typography-body2-font-family`
| `--forge-typography-body2-font-size`
| `--forge-typography-body2-font-weight`
| `--forge-typography-body2-line-height`
| `--forge-typography-body2-letter-spacing`
| `--forge-typography-body2-text-transform`
| `--forge-typography-body2-text-decoration`

Each style has a similar set of tokens that allow for you to granularly customize the font styles used in your application.
Expand Down
1 change: 1 addition & 0 deletions src/stories/getting-started/Typography.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Label styles are used for small text such as form labels and captions.
| :------------------------- | :------------------------------------------------------ |
| `forge-typography--label1` | <div className="forge-typography--label1">Label 1</div> |
| `forge-typography--label2` | <div className="forge-typography--label2">Label 2</div> |
| `forge-typography--label3` | <div className="forge-typography--label3">Label 3</div> |

</Unstyled>

Expand Down
Loading