Skip to content

Commit 60deb04

Browse files
authored
Revert "fix: stretch slotted content to full cross-axis size in master-detail-layout (#11364)" (#11369)
This reverts commit 7735cf2.
1 parent 30fd9be commit 60deb04

File tree

4 files changed

+3
-22
lines changed

4 files changed

+3
-22
lines changed

dev/master-detail-layout.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
.master {
3535
box-sizing: border-box;
36+
height: 100%;
3637
padding: 1.5rem;
3738
overflow: auto;
3839
}
@@ -61,6 +62,7 @@
6162

6263
.static-detail {
6364
box-sizing: border-box;
65+
height: 100%;
6466
padding: 1.5rem;
6567
overflow: auto;
6668
}

packages/master-detail-layout/ARCHITECTURE.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ In vertical mode, `grid-template-rows` replaces `grid-template-columns` using th
3838

3939
`--_master-size` and `--_detail-size` default to `30em` and `15em` respectively in `:host`. When `masterSize`/`detailSize` properties are set, JS overrides these CSS custom properties. When cleared, JS removes the inline style and the defaults apply again.
4040

41-
## Slotted Content Stretching
42-
43-
`::slotted(*) { height: 100% }` makes all slotted content stretch to fill the cross-axis by default. In horizontal mode, children fill the full height; in vertical mode, block elements already fill width naturally. This low-specificity rule is easily overridden by explicit height on slotted elements.
44-
4541
## Overflow Detection
4642

4743
`__checkOverflow()` reads the first 3 of the 4 computed track sizes: `[masterSize, masterExtra, detailSize]`. The 4th (detail extra) is 0 in overflow scenarios.

packages/master-detail-layout/src/styles/vaadin-master-detail-layout-base-styles.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ export const masterDetailLayoutStyles = css`
3737
box-sizing: border-box;
3838
}
3939
40-
::slotted(*) {
41-
height: 100%;
42-
}
43-
4440
[part~='master'] {
4541
grid-column: master-start / detail-start;
4642
}

packages/master-detail-layout/test/master-detail-layout.test.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ describe('vaadin-master-detail-layout', () => {
114114
});
115115

116116
it('should trigger observer when a direct child is resized', async () => {
117-
let height = 100;
118117
for (const child of layout.children) {
119-
child.style.height = `${height}px`;
120-
height += 100;
118+
child.style.height = '100px';
121119
await onceResized(layout);
122120
expect(onResizeSpy).to.be.called;
123121
onResizeSpy.resetHistory();
@@ -154,16 +152,5 @@ describe('vaadin-master-detail-layout', () => {
154152
expect(parseFloat(getComputedStyle(master).height)).to.equal(500);
155153
expect(parseFloat(getComputedStyle(detail).height)).to.equal(500);
156154
});
157-
158-
it('should stretch slotted content to full height', async () => {
159-
layout.masterSize = '200px';
160-
layout.detailSize = '200px';
161-
layout.parentElement.style.height = '500px';
162-
await onceResized(layout);
163-
const masterContent = layout.querySelector(':not([slot])');
164-
const detailContent = layout.querySelector('[slot="detail"]');
165-
expect(masterContent.offsetHeight).to.equal(500);
166-
expect(detailContent.offsetHeight).to.equal(500);
167-
});
168155
});
169156
});

0 commit comments

Comments
 (0)