Skip to content

Commit

Permalink
Fonts: New heading style h4 (#3333)
Browse files Browse the repository at this point in the history
  • Loading branch information
AgreSanGit authored Jan 15, 2024
1 parent 43416c0 commit 69b5010
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,28 @@ <h1 class="sample-header-1 kirby-text-xlarge">h1 - Heading 1</h1>
<div class="info-box">
<code>font-size: font-size("xl");</code>
<code>font-weight: font-weight("black");</code>
<code class="highlight">CLASS: h1 or .kirby-text-xlarge</code>
<code class="highlight">CLASS: kirby-text-xlarge</code>
</div>

<h2 class="sample-header-2 kirby-text-large">h2 - Heading 2</h2>
<div class="info-box">
<code>font-size: font-size("l");</code>
<code>font-weight: font-weight("bold");</code>
<code class="highlight">CLASS: h2 or kirby-text-large</code>
<code class="highlight">CLASS: kirby-text-large</code>
</div>

<h3 class="sample-header-3 kirby-text-medium">h3 - Heading 3</h3>
<div class="info-box">
<code>font-size: font-size("m");</code>
<code>font-weight: font-weight("bold");</code>
<code class="highlight">CLASS: h3 or kirby-text-medium</code>
<code class="highlight">CLASS: kirby-text-medium</code>
</div>

<h4 class="sample-header-4 kirby-text-normal-bold">h4 - Section header</h4>
<div class="info-box">
<code>font-size: font-size("n");</code>
<code>font-weight: font-weight("bold");</code>
<code class="highlight">CLASS: kirby-text-normal-bold</code>
</div>

<p class="sample-body kirby-text-normal">p - Paragraph (Default body font)</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ code {
&-header-1,
&-header-2,
&-header-3,
&-header-4,
&-body,
&-body-small,
&-body-small-light,
Expand Down Expand Up @@ -61,6 +62,12 @@ code {
}
}

&-header-4 {
&::after {
content: '(#{utils.font-size('n')})';
}
}

&-body {
&::after {
content: '(#{utils.font-size('n')})';
Expand Down
8 changes: 8 additions & 0 deletions libs/core/src/scss/base/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ h3,
line-height: functions.line-height('m');
}

h4,
.h4,
.kirby-text-normal-bold {
font-size: functions.font-size('n');
font-weight: functions.font-weight('bold');
line-height: functions.line-height('n');
}

p,
.p,
.kirby-text-normal {
Expand Down
7 changes: 7 additions & 0 deletions libs/designsystem/helpers/scss/src/typography.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ describe('Typography', () => {
fontWeight: '700',
lineHeight: '24px',
},
'heading 4': {
tag: 'h4',
cssClasses: ['h4', 'kirby-text-normal-bold'],
fontSize: '16px',
fontWeight: '700',
lineHeight: '24px',
},
};

for (const headingName in headings) {
Expand Down

0 comments on commit 69b5010

Please sign in to comment.