@@ -10,6 +10,7 @@ export default {
10
10
id : 'uui-tag' ,
11
11
args : {
12
12
look : '' ,
13
+ fontSize : 12 ,
13
14
slot : 'Hello' ,
14
15
} ,
15
16
argTypes : {
@@ -26,24 +27,18 @@ export default {
26
27
] ,
27
28
} ,
28
29
'--uui-tag-font-size' : { control : { type : 'text' } } ,
30
+ fontSize : { table : { category : 'Styles' } } ,
29
31
} ,
30
32
} ;
31
33
32
- const tagSizes = [ '9px' , '12px' , '15px' , '18px' ] ;
33
-
34
34
const Template : Story = props => html `
35
- < uui-tag .look =${ props . look } > ${ props . slot } </ uui-tag >
35
+ < uui-tag look =${ props . look } style ="font-size: ${ props . fontSize } px;"
36
+ > ${ props . slot } </ uui-tag
37
+ >
36
38
` ;
37
39
38
40
export const AAAOverview = Template . bind ( { } ) ;
39
41
AAAOverview . storyName = 'Overview' ;
40
- AAAOverview . parameters = {
41
- docs : {
42
- source : {
43
- code : `<uui-tag>Hello</uui-tag>` ,
44
- } ,
45
- } ,
46
- } ;
47
42
48
43
export const Looks : Story = ( ) =>
49
44
html `
@@ -68,30 +63,15 @@ Looks.parameters = {
68
63
} ,
69
64
} ;
70
65
71
- export const Sizing : Story = ( ) =>
66
+ export const Sizing : Story = props =>
72
67
html `
73
- ${ tagSizes . map (
74
- size =>
75
- html `< uui-tag style ="font-size:${ size } ; " look ="primary "
76
- > ${ size } </ uui-tag
77
- > `
78
- ) }
68
+ < uui-tag style ="font-size:${ props . fontSize } px; " look ="primary "
69
+ > ${ props . slot } </ uui-tag
70
+ >
79
71
` ;
80
72
81
73
Sizing . parameters = {
82
- controls : {
83
- include : [ 'look' ] ,
84
- } ,
85
- docs : {
86
- source : {
87
- code : `
88
- <uui-tag style="font-size:9px;" look="primary">9px</uui-tag>
89
- <uui-tag style="font-size:12px;" look="primary">12px</uui-tag>
90
- <uui-tag style="font-size:15px;" look="primary">15px</uui-tag>
91
- <uui-tag style="font-size:18px;" look="primary">18px</uui-tag>
92
- ` ,
93
- } ,
94
- } ,
74
+ controls : { include : [ 'fontSize' , 'slot' ] } ,
95
75
} ;
96
76
97
77
// - Would you ever put a button inside a tag? - asked Jesper.
0 commit comments