Skip to content

Commit 37093e9

Browse files
committed
feat: enhance app-header integration and improve tab sheet layout with new styles and slots
1 parent 1b6fb17 commit 37093e9

File tree

7 files changed

+11
-7
lines changed

7 files changed

+11
-7
lines changed

app/ollama-tools/ollama-tools.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2>Ollama Tool Calling</h2>
1+
<app-header><h2>Ollama Tool Calling</h2></app-header>
22

33
<dynamic-rows>
44
<div data-height="1fr">

app/tab-sheet/tab-sheet.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
h2 {
22
color: darkslateblue;
33
}
4+
5+
app-header {
6+
flex: 1;
7+
}

app/tab-sheet/tab-sheet.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
<app-header><h2>Tab Sheet</h2></app-header>
2-
31
<tab-sheet>
2+
<app-header slot="prefix"><h2>Tab Sheet</h2></app-header>
43
<div slot="tab" for="tab1">Tab 1</div>
54
<div slot="tab" for="tab2">Tab 2</div>
65
<div slot="tab" for="tab3">Tab 3</div>

components/app-header/app-header.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
align-items: center;
77

88
padding: var(--padding);
9-
border-bottom: var(--border);
109
}
1110

1211
button {

components/tab-sheet/tab-sheet.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:host {
22
--cl-suppressed: gray;
3+
--tabs-padding: 0 0.5rem;
34
display: flex;
45
}
56

@@ -15,6 +16,7 @@
1516
align-items: center;
1617
justify-content: start;
1718
border-bottom: 1px solid var(--cl-border);
19+
padding: var(--tabs-padding);
1820
}
1921

2022
.content {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export const HTML = `
22
<link rel="stylesheet" href="${new URL("./tab-sheet.css", import.meta.url).href}" />
3-
<slot name="prefix"></slot>
43
<div class="tab-sheet">
54
<div class="header">
5+
<slot name="prefix"></slot>
66
<slot name="tab"></slot>
7+
<slot name="suffix"></slot>
78
</div>
89
<div class="content">
910
<slot></slot>
1011
</div>
1112
</div>
12-
<slot name="suffix"></slot>
1313
`

components/tab-sheet/tab-sheet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class TabSheet extends HTMLElement {
4242
}
4343

4444
#selectFirstTab() {
45-
const slot = this.shadowRoot.querySelector(".header slot");
45+
const slot = this.shadowRoot.querySelector(".header slot[name='tab']");
4646
const elements = slot.assignedElements();
4747
if (elements.length === 0) return;
4848

0 commit comments

Comments
 (0)