-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #547 from LifeSG/BOOKINGSG-5981
Bookingsg 5981
- Loading branch information
Showing
10 changed files
with
197 additions
and
42 deletions.
There are no files selected for viewing
93 changes: 93 additions & 0 deletions
93
src/spec/text-spec/base-plus-jakarta-sans-text-style-set.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { FontFamily } from "./font-spec"; | ||
import { TextStyleSetType } from "../../text/types"; | ||
|
||
// In rem unit | ||
export const BasePlusSansJakartaStyleSet: TextStyleSetType = { | ||
D1: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 3, | ||
fontWeight: 700, | ||
lineHeight: 3.5, | ||
letterSpacing: -0.056, | ||
}, | ||
D2: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 2.5, | ||
fontWeight: 700, | ||
lineHeight: 3, | ||
letterSpacing: -0.032, | ||
}, | ||
D3: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 1.625, | ||
fontWeight: 700, | ||
lineHeight: 2.25, | ||
}, | ||
D4: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 1.375, | ||
fontWeight: 700, | ||
lineHeight: 1.75, | ||
}, | ||
|
||
DBody: { | ||
fontFamily: FontFamily.PlusJakartaSans.Regular, | ||
fontSize: 1.375, | ||
lineHeight: 1.75, | ||
}, | ||
H1: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 2, | ||
fontWeight: 700, | ||
lineHeight: 2.5, | ||
letterSpacing: -0.032, | ||
}, | ||
H2: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 1.625, | ||
fontWeight: 700, | ||
lineHeight: 2.25, | ||
}, | ||
H3: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 1.375, | ||
fontWeight: 700, | ||
lineHeight: 1.75, | ||
}, | ||
H4: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 1.125, | ||
fontWeight: 700, | ||
lineHeight: 1.75, | ||
}, | ||
H5: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 1, | ||
fontWeight: 700, | ||
lineHeight: 1.5, | ||
}, | ||
H6: { | ||
fontFamily: FontFamily.PlusJakartaSans.Bold, | ||
fontSize: 0.875, | ||
fontWeight: 700, | ||
lineHeight: 1.625, | ||
letterSpacing: 0.012, | ||
}, | ||
Body: { | ||
fontFamily: FontFamily.PlusJakartaSans.Regular, | ||
fontSize: 1.125, | ||
lineHeight: 1.75, | ||
}, | ||
BodySmall: { | ||
fontFamily: FontFamily.PlusJakartaSans.Regular, | ||
fontSize: 1, | ||
lineHeight: 1.5, | ||
letterSpacing: 0.014, | ||
}, | ||
XSmall: { | ||
fontFamily: FontFamily.PlusJakartaSans.Regular, | ||
fontSize: 0.75, | ||
lineHeight: 1.2, | ||
letterSpacing: 0.012, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import { TFontFamily } from "./types"; | ||
|
||
export const FontFamily = { | ||
OpenSans: { | ||
Regular: "Open Sans", | ||
Semibold: "Open Sans Semibold", | ||
Bold: "Open Sans Bold", | ||
Light: "Open Sans Light", | ||
}, | ||
PlusJakartaSans: { | ||
Regular: "Plus Jakarta Sans", | ||
Semibold: "Plus Jakarta Sans Semibold", | ||
Bold: "Plus Jakarta Sans Bold", | ||
Light: "Plus Jakarta Sans Light", | ||
}, | ||
MerriWeather: "Merriweather", | ||
}; | ||
} satisfies TFontFamily; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type FontWeights = "Regular" | "Semibold" | "Bold" | "Light"; | ||
|
||
export type FontWeightSpec = Record<FontWeights, string>; | ||
|
||
export type TFontFamily = Record<string, FontWeightSpec | string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Meta, Unstyled } from "@storybook/blocks"; | ||
import { Text } from "src/text"; | ||
import { BasePlusSansJakartaStyleSet } from "src/spec/text-spec/base-plus-jakarta-sans-text-style-set"; | ||
import { Secondary, Title } from "../storybook-common"; | ||
import { FontDisplay, FontSizeDisplay } from "./collection-doc-elements"; | ||
import { BaseTheme } from "../../src"; | ||
import { ThemeProvider } from "styled-components"; | ||
|
||
<Meta title="General/Text/PlusSansJakarta Style" /> | ||
|
||
<Title>Plus Jakarta Sans Style</Title> | ||
|
||
<Secondary>Overview</Secondary> | ||
|
||
This will be the collection used when the `textStyleScheme` is `plusJakartaSans`. | ||
|
||
```tsx | ||
const theme: ThemeSpec = { | ||
textStyleScheme: "plusJakartaSans", | ||
// ...other specifications | ||
}; | ||
``` | ||
|
||
<Secondary>Font Family</Secondary> | ||
|
||
<ThemeProvider theme={{ ...BaseTheme, textStyleScheme: "plusJakartaSans" }}> | ||
|
||
<Text.D1>Plus Jakarta Sans</Text.D1> | ||
<Unstyled> | ||
<FontDisplay /> | ||
</Unstyled> | ||
|
||
<Secondary>Text Styles</Secondary> | ||
<Unstyled> | ||
<FontSizeDisplay textStyles={BasePlusSansJakartaStyleSet} /> | ||
</Unstyled> | ||
|
||
</ThemeProvider> |