Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/foundations/docs/FontsSizes.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ In some cases it may make sense to set the `font-size` and `line-height` manuall

```css
.text-element {
font-size: var(--db-type-body-font-size-XX);
line-height: var(--db-type-body-line-height-XX);
font: var(--db-type-body-XX);
}
```
19 changes: 6 additions & 13 deletions showcases/patternhub/pages/foundations/font-sizes/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,31 @@ import IntrinsicElements = React.JSX.IntrinsicElements;

const overwriteHeadlineMarkdown = `/* Select a headline tag to be overwritten */
h1 {
font-size: var(--db-type-headline-font-size-XX);
line-height: var(--db-type-headline-line-height-XX);
font: var(--db-type-headline-XX);

/* spacings may vary depending on the project */
margin-block: var(--db-spacing-fixed-XX);
}
`;

const getCodeExampleBodyFontSize = (size: string) => `.db-font-size-${size} {
font-size: var(--db-type-body-font-size-${size});
line-height: var(--db-type-body-line-height-${size});
font: var(--db-type-body-${size});

/* custom properties only for components */
--db-icon-font-weight: var(--db-base-body-icon-weight-${size});
--db-icon-font-size: var(--db-base-body-icon-font-size-${size});
}
`;
const getCodeExampleHeadlineTag = (tag: string, size: string) => `${tag} {
line-height: var(--db-type-headline-line-height-${size});
font-size: var(--db-type-headline-font-size-${size});
font: var(--db-type-headline-${size});
margin-block: var(--db-spacing-fixed-${size});
}
`;

const getCodeExampleHeadlineSizes = (
size: string
) => `.custom-headline-selector {
line-height: var(--db-type-headline-line-height-${size});
font-size: var(--db-type-headline-font-size-${size});
font: var(--db-type-headline-${size});
margin-block: var(--db-spacing-fixed-${size});
}
`;
Expand Down Expand Up @@ -200,8 +196,7 @@ const ColorOverview = () => {
<>
<h3
style={{
fontSize: `var(--db-type-headline-font-size-${size})`,
lineHeight: `var(--db-type-headline-line-height-${size})`,
font: `var(--db-type-headline-${size})`,
marginBlock: `var(--db-spacing-fixed-${size})`
}}>
Headline with size: <u>{size}</u>
Expand Down Expand Up @@ -240,9 +235,7 @@ const ColorOverview = () => {
<p>
<b>These custom properties must be used for overwrites:</b>
</p>
<code>--db-type-headline-font-size-XX</code>
<br />
<code>--db-type-headline-line-height-XX</code>
<code>--db-type-headline-XX</code>
<br />
<code>--db-spacing-fixed-XX</code> (optional e.g. for margin)
<p>
Expand Down
3 changes: 1 addition & 2 deletions showcases/patternhub/styles/decision-tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
text-align: center;

h2 {
font-size: var(--db-type-headline-font-size-3xs);
line-height: var(--db-type-headline-line-height-3xs);
font: var(--db-type-headline-3xs);
margin-block: var(--db-spacing-fixed-3xs);
}

Expand Down
Loading