Skip to content

Commit

Permalink
feat(Heading): add composable-header-title variant (#66)
Browse files Browse the repository at this point in the history
* feat(Heading): add composable-header-title variant

* feat(fonts): add Tiempos 500 font face
  • Loading branch information
HeartSquared authored Jul 5, 2024
1 parent 4b50ecc commit edbf278
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-ways-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/typography": minor
---

Add `composable-header-title` variant to `Heading`.
5 changes: 5 additions & 0 deletions packages/typography/docs/Heading.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ const StickerSheetTemplate: StoryFn<{ isReversed: boolean }> = ({
Let&apos;s create a better world of work
</Heading>
</StoryWrapper.Row>
<StoryWrapper.Row rowTitle="Composable header title">
<Heading variant="composable-header-title" color={fontColour}>
Use me in the composable header!
</Heading>
</StoryWrapper.Row>
<StoryWrapper.Row rowTitle="Heading 1">
<div>
<Heading variant="heading-1" color={fontColour}>
Expand Down
8 changes: 8 additions & 0 deletions packages/typography/src/Heading/Heading.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
letter-spacing: $typography-display-0-letter-spacing;
}

.composable-header-title {
font-family: $typography-display-0-font-family; // Tiempos
font-weight: 500; // Medium
font-size: $typography-heading-1-font-size;
line-height: $typography-heading-1-line-height;
letter-spacing: $typography-heading-1-letter-spacing;
}

.heading-1 {
font-family: $typography-heading-1-font-family;
font-weight: $typography-heading-1-font-weight;
Expand Down
2 changes: 2 additions & 0 deletions packages/typography/src/Heading/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const VARIANTS_24PX_OR_GREATER = ["display-0", "heading-1", "heading-2"]

export type HeadingVariants =
| "display-0"
| "composable-header-title"
| "heading-1"
| "heading-2"
| "heading-3"
Expand Down Expand Up @@ -84,6 +85,7 @@ Heading.displayName = "Heading"
const translateHeadingLevelToTag = (headingLevel: HeadingVariants): string => {
switch (headingLevel) {
case "display-0":
case "composable-header-title":
case "heading-1":
return "h1"
case "heading-2":
Expand Down
7 changes: 7 additions & 0 deletions packages/typography/src/fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
font-weight: 800;
}

@font-face {
font-family: "Tiempos Headline";
src: url(asset-url("fonts/tiempos/tiempos-headline-medium.woff2")),
url(asset-url("fonts/tiempos/tiempos-headline-medium.woff"));
font-weight: 500;
}

// =============== GREYCLIFF ===============

@font-face {
Expand Down

0 comments on commit edbf278

Please sign in to comment.