|
| 1 | +import type { FontSizeValue } from './interfaces.js' |
| 2 | +import type { FontWeightValue } from './interfaces.js' |
| 3 | +import type { LetterSpacingValue } from './interfaces.js' |
| 4 | +import type { LineHeightValue } from './interfaces.js' |
| 5 | +import type { TypographyStyle } from './interfaces.js' |
| 6 | + |
| 7 | +import { scienceGothicFontFamily } from './font-faces.js' |
| 8 | +import { fontSizes } from './font-sizes.js' |
| 9 | +import { fontWeights } from './font-weights.js' |
| 10 | +import { letterSpacings } from './letter-spacings.js' |
| 11 | +import { lineHeights } from './line-heights.js' |
| 12 | + |
| 13 | +const createTextStyle = ( |
| 14 | + fontSize: FontSizeValue, |
| 15 | + lineHeight: LineHeightValue, |
| 16 | + fontWeight: FontWeightValue, |
| 17 | + letterSpacing: LetterSpacingValue |
| 18 | +): TypographyStyle => ({ |
| 19 | + fontFamily: scienceGothicFontFamily, |
| 20 | + fontSize, |
| 21 | + lineHeight, |
| 22 | + fontWeight, |
| 23 | + letterSpacing, |
| 24 | +}) |
| 25 | + |
| 26 | +export const textStyles = { |
| 27 | + display: { |
| 28 | + lg: createTextStyle(fontSizes.xl6, lineHeights.xl4, fontWeights.semiBold, letterSpacings.md), |
| 29 | + md: createTextStyle(fontSizes.xl5, lineHeights.xl3, fontWeights.semiBold, letterSpacings.md), |
| 30 | + sm: createTextStyle(fontSizes.xl4, lineHeights.xl2, fontWeights.semiBold, letterSpacings.md), |
| 31 | + }, |
| 32 | + heading: { |
| 33 | + lg: createTextStyle(fontSizes.xl3, lineHeights.xl, fontWeights.medium, letterSpacings.md), |
| 34 | + md: createTextStyle(fontSizes.xl2, lineHeights.lg, fontWeights.medium, letterSpacings.md), |
| 35 | + sm: createTextStyle(fontSizes.xl, lineHeights.md, fontWeights.medium, letterSpacings.md), |
| 36 | + }, |
| 37 | + title: { |
| 38 | + lg: createTextStyle(fontSizes.lg, lineHeights.sm, fontWeights.medium, letterSpacings.md), |
| 39 | + md: createTextStyle(fontSizes.md, lineHeights.sm, fontWeights.medium, letterSpacings.md), |
| 40 | + }, |
| 41 | + body: { |
| 42 | + lg: createTextStyle(fontSizes.md, lineHeights.sm, fontWeights.regular, letterSpacings.md), |
| 43 | + md: createTextStyle(fontSizes.sm, lineHeights.xs, fontWeights.regular, letterSpacings.md), |
| 44 | + sm: createTextStyle(fontSizes.xs, lineHeights.xs2, fontWeights.regular, letterSpacings.md), |
| 45 | + }, |
| 46 | + label: { |
| 47 | + lg: createTextStyle(fontSizes.md, lineHeights.xs, fontWeights.medium, letterSpacings.lg), |
| 48 | + md: createTextStyle(fontSizes.sm, lineHeights.xs, fontWeights.medium, letterSpacings.lg), |
| 49 | + sm: createTextStyle(fontSizes.xs, lineHeights.xs2, fontWeights.medium, letterSpacings.lg), |
| 50 | + }, |
| 51 | + caption: createTextStyle(fontSizes.xs2, lineHeights.xs2, fontWeights.regular, letterSpacings.xl), |
| 52 | + overline: createTextStyle(fontSizes.xs3, lineHeights.xs3, fontWeights.medium, letterSpacings.xl), |
| 53 | +} as const |
0 commit comments