@lizzy-liang-bigstack/theme 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +15 -0
- package/dist/index.d.cts +743 -0
- package/dist/index.d.ts +743 -0
- package/dist/index.js +1815 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1811 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +30 -0
- package/src/cubePreset.ts +18 -0
- package/src/cubeTheme.ts +263 -0
- package/src/index.css +15 -0
- package/src/index.ts +14 -0
- package/src/plugins/backgroundGradientPlugin.ts +18 -0
- package/src/plugins/iconPlugin.ts +54 -0
- package/src/plugins/skeletonPlugin.ts +13 -0
- package/src/plugins/typographyPlugin.ts +22 -0
- package/src/utils/animationKeyframes.ts +81 -0
- package/src/utils/animations.ts +44 -0
- package/src/utils/genericTypes.ts +19 -0
- package/src/utils/typography/primaryBodies.ts +53 -0
- package/src/utils/typography/primaryHeadings.ts +45 -0
- package/src/utils/typography/secondaryBodies.ts +61 -0
- package/src/utils/typography/secondaryHeadings.ts +45 -0
- package/src/utils/typography/typography.ts +72 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { PluginCreator } from 'tailwindcss/types/config'
|
|
2
|
+
|
|
3
|
+
export const iconPlugin: PluginCreator = ({ addComponents }) => {
|
|
4
|
+
addComponents({
|
|
5
|
+
'.icon-xs': {
|
|
6
|
+
width: '10px',
|
|
7
|
+
height: '10px',
|
|
8
|
+
},
|
|
9
|
+
'.icon-frame-xs': {
|
|
10
|
+
width: '16px',
|
|
11
|
+
height: '16px',
|
|
12
|
+
},
|
|
13
|
+
'.icon-sm': {
|
|
14
|
+
width: '12px',
|
|
15
|
+
height: '12px',
|
|
16
|
+
},
|
|
17
|
+
'.icon-frame-sm': {
|
|
18
|
+
width: '24px',
|
|
19
|
+
height: '24px',
|
|
20
|
+
},
|
|
21
|
+
'.icon-md-sm': {
|
|
22
|
+
width: '14px',
|
|
23
|
+
height: '14px',
|
|
24
|
+
},
|
|
25
|
+
'.icon-frame-md-sm': {
|
|
26
|
+
width: '28px',
|
|
27
|
+
height: '28px',
|
|
28
|
+
},
|
|
29
|
+
'.icon-md': {
|
|
30
|
+
width: '16px',
|
|
31
|
+
height: '16px',
|
|
32
|
+
},
|
|
33
|
+
'.icon-frame-md': {
|
|
34
|
+
width: '32px',
|
|
35
|
+
height: '32px',
|
|
36
|
+
},
|
|
37
|
+
'.icon-lg': {
|
|
38
|
+
width: '18px',
|
|
39
|
+
height: '18px',
|
|
40
|
+
},
|
|
41
|
+
'.icon-frame-lg': {
|
|
42
|
+
width: '40px',
|
|
43
|
+
height: '40px',
|
|
44
|
+
},
|
|
45
|
+
'.icon-xl': {
|
|
46
|
+
width: '24px',
|
|
47
|
+
height: '24px',
|
|
48
|
+
},
|
|
49
|
+
'.icon-frame-xl': {
|
|
50
|
+
width: '48px',
|
|
51
|
+
height: '48px',
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PluginCreator } from 'tailwindcss/types/config'
|
|
2
|
+
|
|
3
|
+
export const skeletonPlugin: PluginCreator = ({ addComponents, theme }) => {
|
|
4
|
+
const skeletonColor = theme('colors.functional.skeleton')
|
|
5
|
+
|
|
6
|
+
addComponents({
|
|
7
|
+
'.cos-skeleton': {
|
|
8
|
+
background: `linear-gradient(90deg, transparent 60%, rgba(255, 255, 255, .5) 70%, transparent 80%) ${skeletonColor}`,
|
|
9
|
+
backgroundSize: '200% 100%',
|
|
10
|
+
backgroundPositionX: '180%',
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CSSRuleObject, PluginCreator } from 'tailwindcss/types/config'
|
|
2
|
+
import { typographyMap } from '../utils/typography/typography'
|
|
3
|
+
import { cubeTheme } from '../cubeTheme'
|
|
4
|
+
|
|
5
|
+
export const typographyPlugin: PluginCreator = ({ addComponents }) => {
|
|
6
|
+
const components: CSSRuleObject = Object.fromEntries(
|
|
7
|
+
Object.entries(typographyMap).map(([className, typography]) => {
|
|
8
|
+
const selector = `.${className}`
|
|
9
|
+
const fontFamily =
|
|
10
|
+
cubeTheme.fontFamily[typography.fontFamily].join(', ')
|
|
11
|
+
const definition = {
|
|
12
|
+
fontFamily,
|
|
13
|
+
fontSize: typography.fontSize,
|
|
14
|
+
lineHeight: typography.lineHeight,
|
|
15
|
+
letterSpacing: typography.letterSpacing ?? null,
|
|
16
|
+
fontWeight: typography.fontWeight.toString(),
|
|
17
|
+
}
|
|
18
|
+
return [selector, definition]
|
|
19
|
+
}),
|
|
20
|
+
)
|
|
21
|
+
addComponents(components)
|
|
22
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { KeyValuePair } from 'tailwindcss/types/config'
|
|
2
|
+
|
|
3
|
+
const skeletonKeyframes = {
|
|
4
|
+
'cos-skeleton': {
|
|
5
|
+
'100%': {
|
|
6
|
+
backgroundPositionX: '-20%',
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
} satisfies KeyValuePair<string, KeyValuePair<string, KeyValuePair>>
|
|
10
|
+
|
|
11
|
+
const dotSpinner45Keyframes = {
|
|
12
|
+
'cos-dot-spinner-45-vector-0': {
|
|
13
|
+
'0%, 100%': { opacity: '1' },
|
|
14
|
+
'12.5%, 87.5%': { opacity: '0' },
|
|
15
|
+
},
|
|
16
|
+
'cos-dot-spinner-45-vector-1': {
|
|
17
|
+
'0%, 25%, 100%': { opacity: '0' },
|
|
18
|
+
'12.5%': { opacity: '1' },
|
|
19
|
+
},
|
|
20
|
+
'cos-dot-spinner-45-vector-2': {
|
|
21
|
+
'0%, 12.5%, 37.5%, 100%': { opacity: '0' },
|
|
22
|
+
'25%': { opacity: '1' },
|
|
23
|
+
},
|
|
24
|
+
'cos-dot-spinner-45-vector-3': {
|
|
25
|
+
'0%, 25%, 50%, 100%': { opacity: '0' },
|
|
26
|
+
'37.5%': { opacity: '1' },
|
|
27
|
+
},
|
|
28
|
+
'cos-dot-spinner-45-vector-4': {
|
|
29
|
+
'0%, 37.5%, 62.5%, 100%': { opacity: '0' },
|
|
30
|
+
'50%': { opacity: '1' },
|
|
31
|
+
},
|
|
32
|
+
'cos-dot-spinner-45-vector-5': {
|
|
33
|
+
'0%, 50%, 75%, 100%': { opacity: '0' },
|
|
34
|
+
'62.5%': { opacity: '1' },
|
|
35
|
+
},
|
|
36
|
+
'cos-dot-spinner-45-vector-6': {
|
|
37
|
+
'0%, 62.5%, 87.5%, 100%': { opacity: '0' },
|
|
38
|
+
'75%': { opacity: '1' },
|
|
39
|
+
},
|
|
40
|
+
'cos-dot-spinner-45-vector-7': {
|
|
41
|
+
'0%, 75%, 100%': { opacity: '0' },
|
|
42
|
+
'87.5%': { opacity: '1' },
|
|
43
|
+
},
|
|
44
|
+
} satisfies KeyValuePair<string, KeyValuePair<string, KeyValuePair>>
|
|
45
|
+
|
|
46
|
+
const dotSpinner120Keyframes = {
|
|
47
|
+
'cos-dot-spinner-120-vector-0': {
|
|
48
|
+
'0%, 100%': { opacity: '1' },
|
|
49
|
+
'33.3%, 66.6%': { opacity: '0' },
|
|
50
|
+
},
|
|
51
|
+
'cos-dot-spinner-120-vector-1': {
|
|
52
|
+
'0%, 66.6%, 100%': { opacity: '0' },
|
|
53
|
+
'33.3%': { opacity: '1' },
|
|
54
|
+
},
|
|
55
|
+
'cos-dot-spinner-120-vector-2': {
|
|
56
|
+
'0%, 33.3%, 100%': { opacity: '0' },
|
|
57
|
+
'66.6%': { opacity: '1' },
|
|
58
|
+
},
|
|
59
|
+
} satisfies KeyValuePair<string, KeyValuePair<string, KeyValuePair>>
|
|
60
|
+
|
|
61
|
+
const cubeSpinnerKeyframes = {
|
|
62
|
+
'cos-cube-spinner-vector-0': {
|
|
63
|
+
'0%, 100%': { opacity: '1' },
|
|
64
|
+
'33.3%, 66.6%': { opacity: '0' },
|
|
65
|
+
},
|
|
66
|
+
'cos-cube-spinner-vector-1': {
|
|
67
|
+
'0%, 66.6%, 100%': { opacity: '0' },
|
|
68
|
+
'33.3%': { opacity: '1' },
|
|
69
|
+
},
|
|
70
|
+
'cos-cube-spinner-vector-2': {
|
|
71
|
+
'0%, 33.3%, 100%': { opacity: '0' },
|
|
72
|
+
'66.6%': { opacity: '1' },
|
|
73
|
+
},
|
|
74
|
+
} satisfies KeyValuePair<string, KeyValuePair<string, KeyValuePair>>
|
|
75
|
+
|
|
76
|
+
export const cosAnimationKeyframes = {
|
|
77
|
+
...skeletonKeyframes,
|
|
78
|
+
...dotSpinner45Keyframes,
|
|
79
|
+
...dotSpinner120Keyframes,
|
|
80
|
+
...cubeSpinnerKeyframes,
|
|
81
|
+
} satisfies KeyValuePair<string, KeyValuePair<string, KeyValuePair>>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { KeyValuePair } from 'tailwindcss/types/config'
|
|
2
|
+
|
|
3
|
+
const skeletonAnimations = {
|
|
4
|
+
'cos-skeleton': 'cos-skeleton 1.5s ease-in-out infinite',
|
|
5
|
+
} satisfies KeyValuePair
|
|
6
|
+
|
|
7
|
+
const dotSpinner45VectorShorthand = (vectorIndex: number) =>
|
|
8
|
+
`cos-dot-spinner-45-vector-${vectorIndex} 1s linear infinite`
|
|
9
|
+
|
|
10
|
+
const dotSpinner45Animations = {
|
|
11
|
+
'cos-dot-spinner-45-vector-0': dotSpinner45VectorShorthand(0),
|
|
12
|
+
'cos-dot-spinner-45-vector-1': dotSpinner45VectorShorthand(1),
|
|
13
|
+
'cos-dot-spinner-45-vector-2': dotSpinner45VectorShorthand(2),
|
|
14
|
+
'cos-dot-spinner-45-vector-3': dotSpinner45VectorShorthand(3),
|
|
15
|
+
'cos-dot-spinner-45-vector-4': dotSpinner45VectorShorthand(4),
|
|
16
|
+
'cos-dot-spinner-45-vector-5': dotSpinner45VectorShorthand(5),
|
|
17
|
+
'cos-dot-spinner-45-vector-6': dotSpinner45VectorShorthand(6),
|
|
18
|
+
'cos-dot-spinner-45-vector-7': dotSpinner45VectorShorthand(7),
|
|
19
|
+
} satisfies KeyValuePair
|
|
20
|
+
|
|
21
|
+
const dotSpinner120VectorShorthand = (vectorIndex: number) =>
|
|
22
|
+
`cos-dot-spinner-120-vector-${vectorIndex} 1s linear infinite`
|
|
23
|
+
|
|
24
|
+
const dotSpinner120Animations = {
|
|
25
|
+
'cos-dot-spinner-120-vector-0': dotSpinner120VectorShorthand(0),
|
|
26
|
+
'cos-dot-spinner-120-vector-1': dotSpinner120VectorShorthand(1),
|
|
27
|
+
'cos-dot-spinner-120-vector-2': dotSpinner120VectorShorthand(2),
|
|
28
|
+
} satisfies KeyValuePair
|
|
29
|
+
|
|
30
|
+
const cubeSpinnerVectorShorthand = (vectorIndex: number) =>
|
|
31
|
+
`cos-cube-spinner-vector-${vectorIndex} 1.25s linear infinite`
|
|
32
|
+
|
|
33
|
+
const cubeSpinnerAnimations = {
|
|
34
|
+
'cos-cube-spinner-vector-0': cubeSpinnerVectorShorthand(0),
|
|
35
|
+
'cos-cube-spinner-vector-1': cubeSpinnerVectorShorthand(1),
|
|
36
|
+
'cos-cube-spinner-vector-2': cubeSpinnerVectorShorthand(2),
|
|
37
|
+
} satisfies KeyValuePair
|
|
38
|
+
|
|
39
|
+
export const cosAnimations = {
|
|
40
|
+
...skeletonAnimations,
|
|
41
|
+
...dotSpinner45Animations,
|
|
42
|
+
...dotSpinner120Animations,
|
|
43
|
+
...cubeSpinnerAnimations,
|
|
44
|
+
} satisfies KeyValuePair
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type FlattenObjectKeysInternal<
|
|
2
|
+
T extends Record<string | number, unknown>,
|
|
3
|
+
Separator extends string = '.',
|
|
4
|
+
ExcludedKeys extends string | number = '',
|
|
5
|
+
Key = keyof T,
|
|
6
|
+
> = Key extends string | number
|
|
7
|
+
? Key extends ExcludedKeys
|
|
8
|
+
? never
|
|
9
|
+
: T[Key] extends Record<string | number, unknown>
|
|
10
|
+
? `${Key}${Separator}${FlattenObjectKeysInternal<T[Key], Separator, ExcludedKeys>}`
|
|
11
|
+
: `${Key}`
|
|
12
|
+
: never
|
|
13
|
+
|
|
14
|
+
export type FlattenedObjectKeys<
|
|
15
|
+
T extends Record<string | number, unknown>,
|
|
16
|
+
Separator extends string = '.',
|
|
17
|
+
ExcludedKeys extends string | number = '',
|
|
18
|
+
> = FlattenObjectKeysInternal<T, Separator, ExcludedKeys>
|
|
19
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Typography } from './typography'
|
|
2
|
+
|
|
3
|
+
const FONT_FAMILY = 'inter' satisfies Typography['fontFamily']
|
|
4
|
+
const LETTER_SPACING = 'normal' as const
|
|
5
|
+
const FONT_WEIGHT = 400 as const
|
|
6
|
+
|
|
7
|
+
export const primaryBody1: Typography = {
|
|
8
|
+
fontFamily: FONT_FAMILY,
|
|
9
|
+
fontSize: '15px',
|
|
10
|
+
lineHeight: '22px',
|
|
11
|
+
letterSpacing: LETTER_SPACING,
|
|
12
|
+
fontWeight: FONT_WEIGHT,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const primaryBody2: Typography = {
|
|
16
|
+
fontFamily: FONT_FAMILY,
|
|
17
|
+
fontSize: '14px',
|
|
18
|
+
lineHeight: '20px',
|
|
19
|
+
letterSpacing: LETTER_SPACING,
|
|
20
|
+
fontWeight: FONT_WEIGHT,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const primaryBody3: Typography = {
|
|
24
|
+
fontFamily: FONT_FAMILY,
|
|
25
|
+
fontSize: '13px',
|
|
26
|
+
lineHeight: '18px',
|
|
27
|
+
letterSpacing: LETTER_SPACING,
|
|
28
|
+
fontWeight: FONT_WEIGHT,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const primaryBody4: Typography = {
|
|
32
|
+
fontFamily: FONT_FAMILY,
|
|
33
|
+
fontSize: '12px',
|
|
34
|
+
lineHeight: '16px',
|
|
35
|
+
letterSpacing: LETTER_SPACING,
|
|
36
|
+
fontWeight: FONT_WEIGHT,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const primaryBody5: Typography = {
|
|
40
|
+
fontFamily: FONT_FAMILY,
|
|
41
|
+
fontSize: '11px',
|
|
42
|
+
lineHeight: '15px',
|
|
43
|
+
letterSpacing: LETTER_SPACING,
|
|
44
|
+
fontWeight: FONT_WEIGHT,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const primaryBody6: Typography = {
|
|
48
|
+
fontFamily: FONT_FAMILY,
|
|
49
|
+
fontSize: '10px',
|
|
50
|
+
lineHeight: '13px',
|
|
51
|
+
letterSpacing: LETTER_SPACING,
|
|
52
|
+
fontWeight: FONT_WEIGHT,
|
|
53
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Typography } from './typography'
|
|
2
|
+
|
|
3
|
+
const FONT_FAMILY = 'urbanist' satisfies Typography['fontFamily']
|
|
4
|
+
const LETTER_SPACING = '0.02em' as const
|
|
5
|
+
const FONT_WEIGHT = 600 as const
|
|
6
|
+
|
|
7
|
+
export const primaryH1: Typography = {
|
|
8
|
+
fontFamily: FONT_FAMILY,
|
|
9
|
+
fontSize: '30px',
|
|
10
|
+
lineHeight: '38px',
|
|
11
|
+
letterSpacing: LETTER_SPACING,
|
|
12
|
+
fontWeight: FONT_WEIGHT,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const primaryH2: Typography = {
|
|
16
|
+
fontFamily: FONT_FAMILY,
|
|
17
|
+
fontSize: '24px',
|
|
18
|
+
lineHeight: '30px',
|
|
19
|
+
letterSpacing: LETTER_SPACING,
|
|
20
|
+
fontWeight: FONT_WEIGHT,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const primaryH3: Typography = {
|
|
24
|
+
fontFamily: FONT_FAMILY,
|
|
25
|
+
fontSize: '20px',
|
|
26
|
+
lineHeight: '24px',
|
|
27
|
+
letterSpacing: LETTER_SPACING,
|
|
28
|
+
fontWeight: FONT_WEIGHT,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const primaryH4: Typography = {
|
|
32
|
+
fontFamily: FONT_FAMILY,
|
|
33
|
+
fontSize: '18px',
|
|
34
|
+
lineHeight: '22px',
|
|
35
|
+
letterSpacing: LETTER_SPACING,
|
|
36
|
+
fontWeight: FONT_WEIGHT,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const primaryH5: Typography = {
|
|
40
|
+
fontFamily: FONT_FAMILY,
|
|
41
|
+
fontSize: '16px',
|
|
42
|
+
lineHeight: '20px',
|
|
43
|
+
letterSpacing: LETTER_SPACING,
|
|
44
|
+
fontWeight: FONT_WEIGHT,
|
|
45
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Typography } from './typography'
|
|
2
|
+
|
|
3
|
+
const FONT_FAMILY = 'urbanist' satisfies Typography['fontFamily']
|
|
4
|
+
const LETTER_SPACING = '0.02em' as const
|
|
5
|
+
const FONT_WEIGHT = 400 as const
|
|
6
|
+
|
|
7
|
+
export const secondaryBody1: Typography = {
|
|
8
|
+
fontFamily: FONT_FAMILY,
|
|
9
|
+
fontSize: '15px',
|
|
10
|
+
lineHeight: '22px',
|
|
11
|
+
letterSpacing: LETTER_SPACING,
|
|
12
|
+
fontWeight: FONT_WEIGHT,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const secondaryBody2: Typography = {
|
|
16
|
+
fontFamily: FONT_FAMILY,
|
|
17
|
+
fontSize: '14px',
|
|
18
|
+
lineHeight: '18px',
|
|
19
|
+
letterSpacing: LETTER_SPACING,
|
|
20
|
+
fontWeight: FONT_WEIGHT,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const secondaryBody3: Typography = {
|
|
24
|
+
fontFamily: FONT_FAMILY,
|
|
25
|
+
fontSize: '13px',
|
|
26
|
+
lineHeight: '16px',
|
|
27
|
+
letterSpacing: LETTER_SPACING,
|
|
28
|
+
fontWeight: FONT_WEIGHT,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const secondaryBody4: Typography = {
|
|
32
|
+
fontFamily: FONT_FAMILY,
|
|
33
|
+
fontSize: '12px',
|
|
34
|
+
lineHeight: '16px',
|
|
35
|
+
letterSpacing: LETTER_SPACING,
|
|
36
|
+
fontWeight: FONT_WEIGHT,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const secondaryBody5: Typography = {
|
|
40
|
+
fontFamily: FONT_FAMILY,
|
|
41
|
+
fontSize: '11px',
|
|
42
|
+
lineHeight: '15px',
|
|
43
|
+
letterSpacing: LETTER_SPACING,
|
|
44
|
+
fontWeight: FONT_WEIGHT,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const secondaryBody6: Typography = {
|
|
48
|
+
fontFamily: FONT_FAMILY,
|
|
49
|
+
fontSize: '10px',
|
|
50
|
+
lineHeight: '14px',
|
|
51
|
+
letterSpacing: LETTER_SPACING,
|
|
52
|
+
fontWeight: FONT_WEIGHT,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const secondaryBody7: Typography = {
|
|
56
|
+
fontFamily: FONT_FAMILY,
|
|
57
|
+
fontSize: '9px',
|
|
58
|
+
lineHeight: '12px',
|
|
59
|
+
letterSpacing: LETTER_SPACING,
|
|
60
|
+
fontWeight: FONT_WEIGHT,
|
|
61
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Typography } from './typography'
|
|
2
|
+
|
|
3
|
+
const FONT_FAMILY = 'inter' satisfies Typography['fontFamily']
|
|
4
|
+
const LETTER_SPACING = '0.02em' as const
|
|
5
|
+
const FONT_WEIGHT = 600 as const
|
|
6
|
+
|
|
7
|
+
export const secondaryH1: Typography = {
|
|
8
|
+
fontFamily: FONT_FAMILY,
|
|
9
|
+
fontSize: '30px',
|
|
10
|
+
lineHeight: '38px',
|
|
11
|
+
letterSpacing: LETTER_SPACING,
|
|
12
|
+
fontWeight: FONT_WEIGHT,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const secondaryH2: Typography = {
|
|
16
|
+
fontFamily: FONT_FAMILY,
|
|
17
|
+
fontSize: '24px',
|
|
18
|
+
lineHeight: '30px',
|
|
19
|
+
letterSpacing: LETTER_SPACING,
|
|
20
|
+
fontWeight: FONT_WEIGHT,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const secondaryH3: Typography = {
|
|
24
|
+
fontFamily: FONT_FAMILY,
|
|
25
|
+
fontSize: '20px',
|
|
26
|
+
lineHeight: '24px',
|
|
27
|
+
letterSpacing: LETTER_SPACING,
|
|
28
|
+
fontWeight: FONT_WEIGHT,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const secondaryH4: Typography = {
|
|
32
|
+
fontFamily: FONT_FAMILY,
|
|
33
|
+
fontSize: '18px',
|
|
34
|
+
lineHeight: '22px',
|
|
35
|
+
letterSpacing: LETTER_SPACING,
|
|
36
|
+
fontWeight: FONT_WEIGHT,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const secondaryH5: Typography = {
|
|
40
|
+
fontFamily: FONT_FAMILY,
|
|
41
|
+
fontSize: '16px',
|
|
42
|
+
lineHeight: '20px',
|
|
43
|
+
letterSpacing: LETTER_SPACING,
|
|
44
|
+
fontWeight: FONT_WEIGHT,
|
|
45
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { cubeTheme } from '../../cubeTheme'
|
|
2
|
+
import {
|
|
3
|
+
primaryBody1,
|
|
4
|
+
primaryBody2,
|
|
5
|
+
primaryBody3,
|
|
6
|
+
primaryBody4,
|
|
7
|
+
primaryBody5,
|
|
8
|
+
primaryBody6,
|
|
9
|
+
} from './primaryBodies'
|
|
10
|
+
import {
|
|
11
|
+
primaryH1,
|
|
12
|
+
primaryH2,
|
|
13
|
+
primaryH3,
|
|
14
|
+
primaryH4,
|
|
15
|
+
primaryH5,
|
|
16
|
+
} from './primaryHeadings'
|
|
17
|
+
import {
|
|
18
|
+
secondaryBody1,
|
|
19
|
+
secondaryBody2,
|
|
20
|
+
secondaryBody3,
|
|
21
|
+
secondaryBody4,
|
|
22
|
+
secondaryBody5,
|
|
23
|
+
secondaryBody6,
|
|
24
|
+
secondaryBody7,
|
|
25
|
+
} from './secondaryBodies'
|
|
26
|
+
import {
|
|
27
|
+
secondaryH1,
|
|
28
|
+
secondaryH2,
|
|
29
|
+
secondaryH3,
|
|
30
|
+
secondaryH4,
|
|
31
|
+
secondaryH5,
|
|
32
|
+
} from './secondaryHeadings'
|
|
33
|
+
|
|
34
|
+
export type Typography = {
|
|
35
|
+
fontFamily: keyof (typeof cubeTheme)['fontFamily']
|
|
36
|
+
fontSize: string
|
|
37
|
+
lineHeight: string
|
|
38
|
+
letterSpacing: string
|
|
39
|
+
fontWeight: number
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const typographyMap = {
|
|
43
|
+
'primary-h1': primaryH1,
|
|
44
|
+
'primary-h2': primaryH2,
|
|
45
|
+
'primary-h3': primaryH3,
|
|
46
|
+
'primary-h4': primaryH4,
|
|
47
|
+
'primary-h5': primaryH5,
|
|
48
|
+
'secondary-h1': secondaryH1,
|
|
49
|
+
'secondary-h2': secondaryH2,
|
|
50
|
+
'secondary-h3': secondaryH3,
|
|
51
|
+
'secondary-h4': secondaryH4,
|
|
52
|
+
'secondary-h5': secondaryH5,
|
|
53
|
+
'primary-body1': primaryBody1,
|
|
54
|
+
'primary-body2': primaryBody2,
|
|
55
|
+
'primary-body3': primaryBody3,
|
|
56
|
+
'primary-body4': primaryBody4,
|
|
57
|
+
'primary-body5': primaryBody5,
|
|
58
|
+
'primary-body6': primaryBody6,
|
|
59
|
+
'secondary-body1': secondaryBody1,
|
|
60
|
+
'secondary-body2': secondaryBody2,
|
|
61
|
+
'secondary-body3': secondaryBody3,
|
|
62
|
+
'secondary-body4': secondaryBody4,
|
|
63
|
+
'secondary-body5': secondaryBody5,
|
|
64
|
+
'secondary-body6': secondaryBody6,
|
|
65
|
+
'secondary-body7': secondaryBody7,
|
|
66
|
+
} as const
|
|
67
|
+
|
|
68
|
+
export type TypographyClassName = keyof typeof typographyMap
|
|
69
|
+
|
|
70
|
+
export const getTypography = (className: TypographyClassName): Typography => {
|
|
71
|
+
return typographyMap[className]
|
|
72
|
+
}
|