Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item: improve styling for slotted textual content #3734

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6b58f95
💄 support global typography override in Item
jakobe Dec 6, 2024
1c1e37b
♻️ remove redundant selector nesting
jakobe Dec 6, 2024
6b75330
✅ add item typography stories
jakobe Dec 6, 2024
e63fbb7
📝 Improve fonts docs
jakobe Dec 6, 2024
0267996
📝 Fonts docs
jakobe Dec 9, 2024
82395bf
💄 Add `.kirby-item-title`
jakobe Dec 9, 2024
ab861ef
📝 Add multiline example
jakobe Dec 9, 2024
346f512
📝 remove h3 usages in Item examples
jakobe Dec 9, 2024
290653c
📝 remove h3 usages in Item examples
jakobe Dec 9, 2024
0000b89
📝 remove h3 and detail attribute usages in Item examples
jakobe Dec 9, 2024
3387583
✅ remove h3 and detail attribute usages in Item tests
jakobe Dec 9, 2024
16ec088
📝 remove detail attribute usages in Item examples
jakobe Dec 9, 2024
6838ae4
📝 remove detail attribute usages in Item examples
jakobe Dec 9, 2024
d5391b7
📝 remove h3 usages in Item examples
jakobe Dec 9, 2024
7f491ab
✅ remove detail attribute usages in Item tests
jakobe Dec 9, 2024
c8c8355
📝 remove detail attribute usages in Item examples
jakobe Dec 9, 2024
9ef93f8
✅ remove h3 attribute usages in Item tests
jakobe Dec 9, 2024
95496d2
Merge branch 'develop' into enhancement/3721-item-improve-styling-for…
jakobe Dec 9, 2024
cd2fecf
📝 typo
jakobe Dec 9, 2024
41f9370
Merge branch 'enhancement/3721-item-improve-styling-for-slotted-textu…
jakobe Dec 9, 2024
b5e1be2
📝 typo
jakobe Dec 10, 2024
72c910b
📝 sync examples page with showcase
jakobe Dec 10, 2024
53567f9
📝 use consistent naming
jakobe Dec 10, 2024
5fd3c08
♿️ replace h3 with p
jakobe Dec 10, 2024
1f7c0bd
📝 add missing imports
jakobe Dec 10, 2024
4453740
💄 add class selectors for detail
jakobe Dec 10, 2024
f89ff81
📝 Improve readability
jakobe Dec 10, 2024
339bd8a
✏️ typo
jakobe Dec 10, 2024
71cfd72
🎨 formatting
jakobe Dec 10, 2024
0a2046d
🎨 formatting
jakobe Dec 10, 2024
2f82661
📝 Improve readability
jakobe Dec 10, 2024
0b62e98
🎨 formatting
jakobe Dec 10, 2024
befb194
📝 Add text styling info
jakobe Dec 10, 2024
a2abd98
Merge branch 'enhancement/3721-item-improve-styling-for-slotted-textu…
jakobe Dec 10, 2024
1831206
♻️ improve naming
jakobe Dec 10, 2024
76b6ddd
✅ Fix failing test
jakobe Dec 10, 2024
4fc30dd
✅ Fix failing test
jakobe Dec 10, 2024
3cd1229
Merge branch 'develop' into enhancement/3721-item-improve-styling-for…
jakobe Dec 10, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const config = {
<kirby-list [items]="itemsFullList.slice(0,4)">
<kirby-item *kirbyListItemTemplate="let item">
<kirby-label>
<h3>{{item.title}}</h3>
<p subtitle>{{item.subTitle}}</p>
<p class="kirby-item-title">{{item.title}}</p>
<p class="kirby-item-subtitle">{{item.subTitle}}</p>
</kirby-label>
<kirby-label slot="end">
<data [value]="item.amount">{{item.amount}}</data>
<data [value]="item.detail" detail>{{item.detail}}</data>
<data [value]="item.detail" class="kirby-item-detail">{{item.detail}}</data>
</kirby-label>
</kirby-item>
</kirby-list>
Expand All @@ -23,12 +23,12 @@ const config = {
<kirby-list [items]="itemsFullList.slice(4,7)">
<kirby-item *kirbyListItemTemplate="let item">
<kirby-label>
<h3>{{item.title}}</h3>
<p subtitle>{{item.subTitle}}</p>
<p class="kirby-item-title">{{item.title}}</p>
<p class="kirby-item-subtitle">{{item.subTitle}}</p>
</kirby-label>
<kirby-label slot="end">
<data [value]="item.amount">{{item.amount}}</data>
<data [value]="item.detail" detail>{{item.detail}}</data>
<data [value]="item.detail" class="kirby-item-detail">{{item.detail}}</data>
</kirby-label>
</kirby-item>
</kirby-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ const config = {
<kirby-list [items]="itemsFullList.slice(0,4)">
<kirby-item *kirbyListItemTemplate="let item">
<kirby-label>
<h3>{{item.title}}</h3>
<p subtitle>{{item.subTitle}}</p>
<p class="kirby-item-title">{{item.title}}</p>
<p class="kirby-item-subtitle">{{item.subTitle}}</p>
</kirby-label>
<kirby-label slot="end">
<data [value]="item.amount">{{item.amount}}</data>
<data [value]="item.detail" detail>{{item.detail}}</data>
<data [value]="item.detail" class="kirby-item-detail">{{item.detail}}</data>
</kirby-label>
</kirby-item>
</kirby-list>
Expand All @@ -22,12 +22,12 @@ const config = {
<kirby-list [items]="itemsFullList.slice(4,7)">
<kirby-item *kirbyListItemTemplate="let item">
<kirby-label>
<h3>{{item.title}}</h3>
<p subtitle>{{item.subTitle}}</p>
<p class="kirby-item-title">{{item.title}}</p>
<p class="kirby-item-subtitle">{{item.subTitle}}</p>
</kirby-label>
<kirby-label slot="end">
<data [value]="item.amount">{{item.amount}}</data>
<data [value]="item.detail" detail>{{item.detail}}</data>
<data [value]="item.detail" class="kirby-item-detail">{{item.detail}}</data>
</kirby-label>
</kirby-item>
</kirby-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
template: `<kirby-card [hasPadding]="true" (click)="noop()">
<kirby-card-header [hasPadding]="false">
<kirby-item [disclosure]="'arrow-more'">
<h3 class="kirby-text-bold">Item disclosure in header</h3>
<p class="kirby-text-normal-bold">Item disclosure in header</p>
</kirby-item>
</kirby-card-header>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const config = {
>
<kirby-icon *ngIf="selected" name="checkmark-selected" slot="start"></kirby-icon>
<kirby-label>
<h3>{{ item.title }}</h3>
<p detail>{{ item.subtitle }}</p>
<p class="kirby-item-title">{{ item.title }}</p>
<p class="kirby-item-detail">{{ item.subtitle }}</p>
</kirby-label>
<kirby-label slot="end">
<data>Value</data>
<data detail>{{ item.value }}</data>
<data class="kirby-item-detail">{{ item.value }}</data>
</kirby-label>
</kirby-item>
</kirby-dropdown>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
<h1 class="kirby-text-display-1">Display 1</h1>
<h2 class="kirby-text-display-2">Display 2</h2>
<h3 class="kirby-text-display-3">Display 3</h3>

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<!-- Paragraphs that are visually the same as headings: -->
<p class="kirby-text-xlarge">kirby-text-xlarge (Heading 1)</p>
<p class="kirby-text-large">kirby-text-large (Heading 2)</p>
<p class="kirby-text-medium">kirby-text-medium (Heading 3)</p>
<p class="kirby-text-normal-bold">kirby-text-normal-bold (Heading 4)</p>

<p class="kirby-text-large">Kirby-text-large</p>

<p class="kirby-text-xsmall">xsmall text</p>
<p class="kirby-text-bold">Bold text (kirby-text-bold)</p>
<p>p - Paragraph (default body font)</p>

<p class="kirby-text-xxsmall">xxsmall text</p>
<p class="kirby-text-small">kirby-text-small</p>
<p class="kirby-text-small-light">kirby-text-small-light</p>
<p class="kirby-text-xsmall">kirby-text-xsmall</p>
<p class="kirby-text-xxsmall">kirby-text-xxsmall</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@use '@kirbydesign/core/src/scss/utils';

:host {
display: block;
height: 100%;
overflow-x: hidden;
background: utils.get-color('background-color');
padding: utils.size('s');
box-sizing: border-box;

@include utils.media('>=medium') {
padding: utils.size('l');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component } from '@angular/core';

@Component({
selector: 'cookbook-fonts-example',
styleUrls: ['./fonts-example.component.scss'],
templateUrl: './fonts-example.component.html',
})
export class FontsExampleComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
<kirby-avatar slot="start" size="xs">
<kirby-icon name="camera"></kirby-icon>
</kirby-avatar>
<h3>Attach image</h3>
<p class="kirby-item-title">Attach image</p>
</kirby-item>`,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const config = {
<kirby-icon name="moneybag"></kirby-icon>
</kirby-avatar>
<kirby-label>
<h3>Title</h3>
<time detail>10.04.2020</time>
<p class="kirby-item-title">Title</p>
<time class="kirby-item-detail">10.04.2020</time>
</kirby-label>
<data slot="end" value="-849.00">-849,00</data>
</kirby-item>`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
<kirby-avatar overlay="true" slot="start">
<kirby-icon name="moneybag"></kirby-icon>
</kirby-avatar>
<h3>Title</h3>
<p class="kirby-item-title">Title</p>
<data slot="end" value="-849.00">-849,00</data>
</kirby-item>`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const config = {
<kirby-icon name="moneybag"></kirby-icon>
</kirby-avatar>
<kirby-label>
<h3>Jake The Snake Insurance</h3>
<p subtitle>Basic Insurance</p>
<p detail>Account - Budget Account</p>
<p class="kirby-item-title">Jake The Snake Insurance</p>
<p class="kirby-item-subtitle">Basic Insurance</p>
<p class="kirby-item-detail">Account - Budget Account</p>
</kirby-label>
<data slot="end" class="kirby-text-bold" value="value">Value</data>
</kirby-item>`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const config = {
</kirby-badge>
</kirby-avatar>
<kirby-label>
<h3>Lorem ipsum quam notem andamus gepulowitzh onga bonga bimmelon sid est insula</h3>
<p detail>Phone, Internet, Streaming services og other</p>
<p class="kirby-item-title">Lorem ipsum quam notem andamus gepulowitzh onga bonga bimmelon sid est insula</p>
<p class="kirby-item-detail">Phone, Internet, Streaming services og other</p>
</kirby-label>
<kirby-flag slot="end" themeColor="success">
<data value="300.00">EUR 300,00</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const config = {
selector: 'cookbook-item-example-button',
template: `<kirby-item>
<kirby-label>
<h3>Title</h3>
<p detail>Detail</p>
<p class="kirby-item-title">Title</p>
<p class="kirby-item-detail">Detail</p>
</kirby-label>
<button slot="end" kirby-button size="sm">Small Button</button>
</kirby-item>`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = {
selector: 'cookbook-item-example-card',
template: `<kirby-card>
<kirby-item selectable="true">
<h3>Title</h3>
<p class="kirby-item-title">Title</p>
<kirby-toggle slot="end"></kirby-toggle>
</kirby-item>
</kirby-card>`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
template: `<kirby-card [hasPadding]="true" (click)="isExpanded = !isExpanded">
<kirby-card-header [hasPadding]="false">
<kirby-item disclosure="arrow-down" [rotateIcon]="isExpanded">
<h3 class="kirby-text-bold">Disclosure animation example</h3>
<p class="kirby-text-normal-bold">Disclosure animation example</p>
</kirby-item>
</kirby-card-header>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
<kirby-avatar overlay="true" slot="start">
<kirby-icon name="moneybag"></kirby-icon>
</kirby-avatar>
<h3>Title</h3>
<p class="kirby-item-title">Title</p>
<kirby-flag slot="end" themeColor="success">
<data value="60.0">60</data>
</kirby-flag>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = {
selector: 'cookbook-item-example-fab-menu',
template: `<kirby-item>
<kirby-avatar slot="start" imageSrc="/assets/images/woman.png"></kirby-avatar>
<h3>Line Maria Sørensen</h3>
<p class="kirby-item-title">Line Maria Sørensen</p>
</kirby-item>`,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const config = {
<kirby-badge themeColor="warning" size="sm"></kirby-badge>
</div>
<kirby-label>
<h3 class="kirby-text-bold">Title</h3>
<p detail>Detail</p>
<p class="kirby-text-normal-bold">Title</p>
<p class="kirby-item-detail">Detail</p>
</kirby-label>
<kirby-flag slot="end" themeColor="success">
<data value="60.0">60</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const config = {
</kirby-avatar>
<kirby-label>
<kirby-label direction="horizontal">
<h3>Lorem ipsum quam notem andamus gepulowitzh onga bonga bimmelon sid est insula</h3>
<time detail>20.12.2017</time>
<p class="kirby-item-title">Lorem ipsum quam notem andamus gepulowitzh onga bonga bimmelon sid est insula</p>
<time class="kirby-item-detail">20.12.2017</time>
</kirby-label>
<p>Die Marvin, your papers have arrived and you should be able to sign these within 1 week from today if you follow the instructions below.</p>
</kirby-label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
<kirby-avatar slot="start">
<kirby-icon name="moneybag"></kirby-icon>
</kirby-avatar>
<h3>Title</h3>
<p class="kirby-item-title">Title</p>
<kirby-form-field slot="end">
<input type="text" kirby-input value="Item with input" borderless="true"/>
</kirby-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
<kirby-avatar slot="start">
<kirby-icon name="moneybag"></kirby-icon>
</kirby-avatar>
<h3>Title</h3>
<p class="kirby-item-title">Title</p>
<kirby-form-field slot="end">
<input type="number" kirby-input value="100.00" borderless="true"/>
</kirby-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
<kirby-avatar overlay="true" slot="start">
<kirby-icon name="moneybag"></kirby-icon>
</kirby-avatar>
<h3>Title</h3>
<p class="kirby-item-title">Title</p>
<kirby-icon slot="end" name="checkmark-selected"></kirby-icon>
</kirby-item>`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const config = {
template: `<kirby-item selectable="true">
<kirby-checkbox slot="start"></kirby-checkbox>
<kirby-label>
<h3>Title</h3>
<p detail>Detail</p>
<p class="kirby-item-title">Title</p>
<p class="kirby-item-detail">Detail</p>
</kirby-label>
<kirby-label slot="end">
<data>Value</data>
<data detail>Detail</data>
<data class="kirby-item-detail">Detail</data>
</kirby-label>
</kirby-item>`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const config = {
template: `<kirby-item selectable="true" selected="true">
<kirby-icon name="checkmark-selected" slot="start"></kirby-icon>
<kirby-label>
<h3>Title</h3>
<p detail>Detail</p>
<p class="kirby-item-title">Title</p>
<p class="kirby-item-detail">Detail</p>
</kirby-label>
<kirby-label slot="end">
<data>Value</data>
<data detail>Detail</data>
<data class="kirby-item-detail">Detail</data>
</kirby-label>
</kirby-item>`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ const config = {
selector: 'cookbook-item-example-picker-default',
template: `<kirby-item selectable="true">
<kirby-label>
<h3 class="kirby-text-bold">Title</h3>
<p detail>Detail</p>
<p class="kirby-text-normal-bold">Title</p>
<p class="kirby-item-detail">Detail</p>
</kirby-label>
<kirby-label slot="end">
<data>Value</data>
<data detail>Detail</data>
<data class="kirby-item-detail">Detail</data>
</kirby-label>
</kirby-item>`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@angular/core';
const config = {
selector: 'cookbook-item-example-settings-disabled',
template: `<kirby-item disabled>
<h3>Disabled</h3>
<p class="kirby-item-title">Disabled</p>
<kirby-toggle slot="end"></kirby-toggle>
</kirby-item>`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@angular/core';
const config = {
selector: 'cookbook-item-example-settings',
template: `<kirby-item>
<h3>Title</h3>
<p class="kirby-item-title">Title</p>
<kirby-toggle slot="end" checked="true"></kirby-toggle>
</kirby-item>`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@angular/core';
const config = {
selector: 'cookbook-item-example-simple-md',
template: `<kirby-item>
<h3>Medium (default)</h3>
<p class="kirby-item-title">Medium (default)</p>
</kirby-item>`,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@angular/core';
const config = {
selector: 'cookbook-item-example-simple-sm',
template: `<kirby-item size="sm">
<h3>Small</h3>
<p class="kirby-item-title">Small</p>
</kirby-item>`,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@angular/core';
const config = {
selector: 'cookbook-item-example-simple-xs',
template: `<kirby-item size="xs">
<h3>Extra small</h3>
<p class="kirby-item-title">Extra small</p>
</kirby-item>`,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@angular/core';
const config = {
selector: 'cookbook-item-example-simple',
template: `<kirby-item>
<h3>Title</h3>
<p class="kirby-item-title">Title</p>
<data slot="end">Value</data>
</kirby-item>`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@angular/core';
const config = {
selector: 'cookbook-item-example-long-title',
template: `<kirby-item>
<h3>Title that will be truncated because it has a very long text that cannot fit in the width of the container as it's way too long for that and this is why it will be truncated</h3>
<p class="kirby-item-title">Title that will be truncated because it has a very long text that cannot fit in the width of the container as it's way too long for that and this is why it will be truncated</p>
<data slot="end">Value</data>
</kirby-item>`,
};
Expand Down
Loading
Loading