File tree 2 files changed +29
-3
lines changed
components/typography/body 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 1
1
import styled from 'styled-components' ;
2
2
3
- export const Lead = styled . div `
3
+ export interface ILeadProps {
4
+ size ?: 'medium' | 'large' ;
5
+ }
6
+
7
+ const fontSize = {
8
+ medium : '20px' ,
9
+ large : '24px' ,
10
+ } ;
11
+
12
+ export const Lead = styled . div < ILeadProps > `
4
13
/* Body/Lead */
5
14
font-family: Red Hat Text;
6
15
font-style: normal;
7
16
font-weight: normal;
8
- font-size: 20px;
9
17
line-height: 150%;
18
+ ${ props => {
19
+ switch ( props . size ) {
20
+ case 'medium' :
21
+ return `font-size: ${ fontSize . medium } ;` ;
22
+ case 'large' :
23
+ return `font-size: ${ fontSize . large } ;` ;
24
+ default :
25
+ return `font-size: ${ fontSize . medium } ;` ;
26
+ }
27
+ } }
10
28
` ;
Original file line number Diff line number Diff line change @@ -13,4 +13,12 @@ const Template: ComponentStory<typeof Lead> = args => (
13
13
</ Lead >
14
14
) ;
15
15
16
- export const Example = Template . bind ( { } ) ;
16
+ export const Medium = Template . bind ( { } ) ;
17
+ Medium . args = {
18
+ size : 'medium' ,
19
+ } ;
20
+
21
+ export const Large = Template . bind ( { } ) ;
22
+ Large . args = {
23
+ size : 'large' ,
24
+ } ;
You can’t perform that action at this time.
0 commit comments