Skip to content

Commit 3bad25e

Browse files
web-padawanclaude
andauthored
chore: add list-detail-extra dev page and refactor shared CSS (#11412)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 626ad9f commit 3bad25e

File tree

8 files changed

+315
-150
lines changed

8 files changed

+315
-150
lines changed

dev/mdl-use-cases/common.css

Lines changed: 78 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,66 @@ body {
66
font-family: system-ui, sans-serif;
77
}
88

9+
/* Reusable pane with a grid filling the remaining space */
910
.master-pane {
1011
display: flex;
1112
flex-direction: column;
1213
height: 100%;
1314
}
1415

16+
.master-pane > :is(h2, h3, h4) {
17+
margin: 0;
18+
padding: 12px 16px;
19+
border-bottom: 1px solid var(--vaadin-border-color-secondary);
20+
}
21+
22+
.master-pane > h2 {
23+
font-size: 1.1rem;
24+
}
25+
1526
.master-pane vaadin-grid {
1627
flex: 1;
1728
min-height: 0;
1829
border: none;
1930
border-radius: 0;
2031
}
2132

22-
.detail-pane {
23-
display: flex;
24-
flex-direction: column;
25-
height: 100%;
26-
overflow: auto;
27-
}
28-
29-
.detail-header {
33+
/* Pane header with back/close button + heading */
34+
.pane-header {
3035
display: flex;
3136
align-items: center;
32-
gap: 12px;
33-
padding: 16px;
37+
gap: 8px;
38+
padding: 12px 16px;
3439
border-bottom: 1px solid var(--vaadin-border-color-secondary);
3540
flex-shrink: 0;
3641
}
3742

38-
.detail-header .close-btn {
43+
.pane-header :is(h2, h3, h4) {
44+
margin: 0;
45+
flex: 1;
46+
}
47+
48+
.pane-header h2 {
49+
font-size: 1.1rem;
50+
}
51+
52+
/* Back / close button used in pane headers */
53+
.back-btn {
3954
cursor: pointer;
4055
background: none;
41-
border: 1px solid #ccc;
56+
border: 1px solid var(--vaadin-border-color-secondary);
4257
border-radius: 6px;
4358
padding: 4px 12px;
4459
font-size: 0.85rem;
4560
}
4661

62+
.detail-pane {
63+
display: flex;
64+
flex-direction: column;
65+
height: 100%;
66+
overflow: auto;
67+
}
68+
4769
.detail-subject {
4870
font-size: 1.2rem;
4971
font-weight: 600;
@@ -61,9 +83,11 @@ body {
6183
}
6284

6385
.detail-body {
64-
padding: 16px 24px;
65-
line-height: 1.7;
66-
font-size: 0.95rem;
86+
flex: 1;
87+
padding: 16px;
88+
line-height: 1.6;
89+
font-size: 0.9rem;
90+
overflow: auto;
6791
}
6892

6993
.detail-body p {
@@ -78,6 +102,45 @@ body {
78102
color: var(--vaadin-text-color-secondary);
79103
}
80104

105+
/* Grid cell: flex column with primary + secondary text */
106+
.grid-cell {
107+
display: flex;
108+
flex-direction: column;
109+
gap: 2px;
110+
padding: 4px 0;
111+
cursor: pointer;
112+
}
113+
114+
.grid-cell .primary {
115+
font-weight: 600;
116+
font-size: 0.9rem;
117+
}
118+
119+
.grid-cell .secondary {
120+
font-size: 0.8rem;
121+
color: var(--vaadin-text-color-secondary);
122+
}
123+
124+
/* Definition list for key-value pairs */
125+
.props-list {
126+
margin: 0;
127+
display: flex;
128+
flex-direction: column;
129+
gap: 12px;
130+
font-size: 0.9rem;
131+
}
132+
133+
.props-list dt {
134+
font-size: 0.8rem;
135+
color: var(--vaadin-text-color-secondary);
136+
margin: 0;
137+
}
138+
139+
.props-list dd {
140+
margin: 2px 0 0;
141+
}
142+
143+
/* Email-specific cell (wider padding) */
81144
.email-cell {
82145
display: flex;
83146
flex-direction: column;

dev/mdl-use-cases/email-folders-list-message.html

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,6 @@
1212
</script>
1313
<link rel="stylesheet" href="./common.css" />
1414
<style>
15-
/* Folder pane */
16-
.folder-pane {
17-
display: flex;
18-
flex-direction: column;
19-
height: 100%;
20-
}
21-
22-
.folder-pane h2 {
23-
margin: 0;
24-
padding: 16px;
25-
font-size: 1.1rem;
26-
border-bottom: 1px solid var(--vaadin-border-color-secondary);
27-
}
28-
29-
.folder-pane vaadin-grid {
30-
flex: 1;
31-
min-height: 0;
32-
border: none;
33-
border-radius: 0;
34-
}
35-
3615
.folder-cell {
3716
display: flex;
3817
align-items: center;
@@ -48,28 +27,8 @@
4827
font-size: 0.8rem;
4928
}
5029

51-
/* Master pane header */
52-
.master-pane-header {
53-
display: flex;
54-
align-items: center;
55-
gap: 8px;
56-
padding: 16px;
57-
border-bottom: 1px solid var(--vaadin-border-color-secondary);
58-
}
59-
60-
.master-pane-header h2 {
61-
margin: 0;
62-
font-size: 1.1rem;
63-
}
64-
65-
.back-btn {
30+
.master-pane .back-btn {
6631
display: none;
67-
cursor: pointer;
68-
background: none;
69-
border: 1px solid #ccc;
70-
border-radius: 6px;
71-
padding: 4px 12px;
72-
font-size: 0.85rem;
7332
}
7433

7534
#outerLayout[overflow] .back-btn {
@@ -86,7 +45,7 @@
8645
overlay-size="100%"
8746
no-animation
8847
>
89-
<div class="folder-pane">
48+
<div class="master-pane">
9049
<h2>Mail</h2>
9150
<vaadin-grid id="folderGrid" theme="no-border no-row-borders"></vaadin-grid>
9251
</div>
@@ -100,7 +59,7 @@ <h2>Mail</h2>
10059
no-animation
10160
>
10261
<div class="master-pane">
103-
<div class="master-pane-header">
62+
<div class="pane-header">
10463
<button class="back-btn" id="backBtn">&larr; Back</button>
10564
<h2 id="folderTitle">Inbox</h2>
10665
</div>
@@ -203,8 +162,8 @@ <h2 id="folderTitle">Inbox</h2>
203162
const detail = document.createElement('div');
204163
detail.classList.add('detail-pane');
205164
detail.innerHTML = `
206-
<div class="detail-header">
207-
<button class="close-btn" id="closeBtn">Close</button>
165+
<div class="pane-header">
166+
<button class="back-btn" id="closeBtn">Close</button>
208167
<div class="detail-subject">${email.subject}</div>
209168
</div>
210169
<div class="detail-meta">

dev/mdl-use-cases/email-list-message.html

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
window.Vaadin.featureFlags.masterDetailLayoutComponent = true;
1212
</script>
1313
<link rel="stylesheet" href="./common.css" />
14-
<style>
15-
.master-pane h2 {
16-
margin: 0;
17-
padding: 16px;
18-
font-size: 1.1rem;
19-
border-bottom: 1px solid var(--vaadin-border-color-secondary);
20-
}
21-
</style>
2214
</head>
2315
<body>
2416
<vaadin-master-detail-layout
@@ -80,8 +72,8 @@ <h2>Inbox</h2>
8072
const detail = document.createElement('div');
8173
detail.classList.add('detail-pane');
8274
detail.innerHTML = `
83-
<div class="detail-header">
84-
<button class="close-btn" id="closeBtn">Close</button>
75+
<div class="pane-header">
76+
<button class="back-btn" id="closeBtn">Close</button>
8577
<div class="detail-subject">${email.subject}</div>
8678
</div>
8779
<div class="detail-meta">

dev/mdl-use-cases/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ <h1>MDL Use Cases</h1>
1313
<li><a href="email-list-message.html">Email — List - Message</a></li>
1414
<li><a href="email-folders-list-message.html">Email — Folders - List - Message</a></li>
1515
<li><a href="nav-section-list-detail.html">Nav → Section → List → Detail</a></li>
16+
<li><a href="list-detail-extra.html">List → Detail → Extra</a></li>
1617
</ul>
1718
</body>
1819
</html>

0 commit comments

Comments
 (0)