File tree 2 files changed +17
-36
lines changed
2 files changed +17
-36
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export function Headings() {
6
6
return (
7
7
< >
8
8
{ headings . map ( heading => (
9
- < Heading as = { heading } key = { `header_${ heading } ` } >
9
+ < Heading as = { heading } key = { `header_${ heading } ` } marginBottom = "4" >
10
10
{ heading . toUpperCase ( ) } (Heading { heading [ 1 ] } )
11
11
</ Heading >
12
12
) ) }
Original file line number Diff line number Diff line change 1
1
import { defineStyle , defineStyleConfig } from '@chakra-ui/react'
2
2
3
- const h1 = defineStyle ( {
4
- fontFamily : "Raleway" ,
5
- fontSize : '2rem' ,
6
- fontStyle : 'normal' ,
7
- fontWeight : '800' ,
8
- lineHeight : '2.25rem'
9
- } )
3
+ function headingStyle ( fontSizeRem : number , lineHeightRem : number ) {
4
+ return defineStyle ( {
5
+ fontFamily : 'Raleway' ,
6
+ fontStyle : 'normal' ,
7
+ fontWeight : '800' ,
8
+ fontSize : `${ fontSizeRem } rem` ,
9
+ lineHeight : `${ lineHeightRem } rem` ,
10
+ letterSpacing : `-${ 0.02 * fontSizeRem } rem` // -2%
11
+ } )
12
+ }
10
13
11
- const h2 = defineStyle ( {
12
- fontFamily : "Raleway" ,
13
- fontSize : '1.5rem' ,
14
- fontStyle : 'normal' ,
15
- fontWeight : '700' ,
16
- lineHeight : '2rem'
17
- } )
14
+ const h1 = headingStyle ( 2.25 , 2.75 )
18
15
19
- const h3 = defineStyle ( {
20
- fontFamily : "Raleway" ,
21
- fontSize : '1.25rem' ,
22
- fontStyle : 'normal' ,
23
- fontWeight : '600' ,
24
- lineHeight : '2rem'
25
- } )
16
+ const h2 = headingStyle ( 1.875 , 2.25 )
26
17
27
- const h4 = defineStyle ( {
28
- fontFamily : "Raleway" ,
29
- fontSize : '1rem' ,
30
- fontStyle : 'normal' ,
31
- fontWeight : '600' ,
32
- lineHeight : '1.75rem'
33
- } )
18
+ const h3 = headingStyle ( 1.125 , 1.5 )
34
19
35
- const h5 = defineStyle ( {
36
- fontFamily : "Raleway" ,
37
- fontSize : '0.875rem' ,
38
- fontStyle : 'normal' ,
39
- fontWeight : '500' ,
40
- lineHeight : '1.75rem'
41
- } )
20
+ const h4 = headingStyle ( 1 , 1.25 )
21
+
22
+ const h5 = headingStyle ( .875 , 1 )
42
23
43
24
const variants = {
44
25
h1,
You can’t perform that action at this time.
0 commit comments