Skip to content

Commit a998dc8

Browse files
mfranzkemichaelmkrausCopilotgithub-actions[bot]
authored
refactor: replaced font leftovers of release 2.x (#4695)
* refactor: replaced leftovers of release 2.x * Update showcases/patternhub/pages/foundations/font-sizes/overview.tsx Co-authored-by: Copilot <[email protected]> * refactor: prettier * auto update snapshots (#4726) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Michael Kraus <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 2be9529 commit a998dc8

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed
668 Bytes
Loading
-1.27 KB
Loading

packages/foundations/docs/FontsSizes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ In some cases it may make sense to set the `font-size` and `line-height` manuall
7979

8080
```css
8181
.text-element {
82-
font-size: var(--db-type-body-font-size-XX);
83-
line-height: var(--db-type-body-line-height-XX);
82+
font: var(--db-type-body-XX);
8483
}
8584
```

showcases/patternhub/pages/foundations/font-sizes/overview.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,31 @@ import IntrinsicElements = React.JSX.IntrinsicElements;
1010

1111
const overwriteHeadlineMarkdown = `/* Select a headline tag to be overwritten */
1212
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);
1514
1615
/* spacings may vary depending on the project */
1716
margin-block: var(--db-spacing-fixed-XX);
1817
}
1918
`;
2019

2120
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});
2422
2523
/* custom properties only for components */
2624
--db-icon-font-weight: var(--db-base-body-icon-weight-${size});
2725
--db-icon-font-size: var(--db-base-body-icon-font-size-${size});
2826
}
2927
`;
3028
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});
3330
margin-block: var(--db-spacing-fixed-${size});
3431
}
3532
`;
3633

3734
const getCodeExampleHeadlineSizes = (
3835
size: string
3936
) => `.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});
4238
margin-block: var(--db-spacing-fixed-${size});
4339
}
4440
`;
@@ -200,8 +196,7 @@ const ColorOverview = () => {
200196
<>
201197
<h3
202198
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})`,
205200
marginBlock: `var(--db-spacing-fixed-${size})`
206201
}}>
207202
Headline with size: <u>{size}</u>
@@ -240,9 +235,9 @@ const ColorOverview = () => {
240235
<p>
241236
<b>These custom properties must be used for overwrites:</b>
242237
</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>)
246241
<br />
247242
<code>--db-spacing-fixed-XX</code> (optional e.g. for margin)
248243
<p>

showcases/patternhub/styles/decision-tree.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
text-align: center;
88

99
h2 {
10-
font-size: var(--db-type-headline-font-size-3xs);
11-
line-height: var(--db-type-headline-line-height-3xs);
10+
font: var(--db-type-headline-3xs);
1211
margin-block: var(--db-spacing-fixed-3xs);
1312
}
1413

0 commit comments

Comments
 (0)