@@ -10,35 +10,31 @@ import IntrinsicElements = React.JSX.IntrinsicElements;
10
10
11
11
const overwriteHeadlineMarkdown = `/* Select a headline tag to be overwritten */
12
12
h1 {
13
- font-size: var(--db-type-headline-font-size-XX);
14
- line-height: var(--db-type-headline-line-height-XX);
13
+ font: var(--db-type-headline-XX);
15
14
16
15
/* spacings may vary depending on the project */
17
16
margin-block: var(--db-spacing-fixed-XX);
18
17
}
19
18
` ;
20
19
21
20
const getCodeExampleBodyFontSize = ( size : string ) => `.db-font-size-${ size } {
22
- font-size: var(--db-type-body-font-size-${ size } );
23
- line-height: var(--db-type-body-line-height-${ size } );
21
+ font: var(--db-type-body-${ size } );
24
22
25
23
/* custom properties only for components */
26
24
--db-icon-font-weight: var(--db-base-body-icon-weight-${ size } );
27
25
--db-icon-font-size: var(--db-base-body-icon-font-size-${ size } );
28
26
}
29
27
` ;
30
28
const getCodeExampleHeadlineTag = ( tag : string , size : string ) => `${ tag } {
31
- line-height: var(--db-type-headline-line-height-${ size } );
32
- font-size: var(--db-type-headline-font-size-${ size } );
29
+ font: var(--db-type-headline-${ size } );
33
30
margin-block: var(--db-spacing-fixed-${ size } );
34
31
}
35
32
` ;
36
33
37
34
const getCodeExampleHeadlineSizes = (
38
35
size : string
39
36
) => `.custom-headline-selector {
40
- line-height: var(--db-type-headline-line-height-${ size } );
41
- font-size: var(--db-type-headline-font-size-${ size } );
37
+ font: var(--db-type-headline-${ size } );
42
38
margin-block: var(--db-spacing-fixed-${ size } );
43
39
}
44
40
` ;
@@ -200,8 +196,7 @@ const ColorOverview = () => {
200
196
< >
201
197
< h3
202
198
style = { {
203
- fontSize : `var(--db-type-headline-font-size-${ size } )` ,
204
- lineHeight : `var(--db-type-headline-line-height-${ size } )` ,
199
+ font : `var(--db-type-headline-${ size } )` ,
205
200
marginBlock : `var(--db-spacing-fixed-${ size } )`
206
201
} } >
207
202
Headline with size: < u > { size } </ u >
@@ -240,9 +235,9 @@ const ColorOverview = () => {
240
235
< p >
241
236
< b > These custom properties must be used for overwrites:</ b >
242
237
</ p >
243
- < code > --db-type-headline-font-size- XX</ code >
244
- < br />
245
- < code > --db-type-headline- line-height-XX </ code >
238
+ < code > --db-type-headline-XX</ code > (This shorthand custom
239
+ property sets both < code > font-size </ code > and { ' ' }
240
+ < code > line-height</ code > )
246
241
< br />
247
242
< code > --db-spacing-fixed-XX</ code > (optional e.g. for margin)
248
243
< p >
0 commit comments