Skip to content

Commit bc5ae29

Browse files
committed
fix(grille-harmonique): prevent section page breaks in print
Switch [part~="chart"] from display:flex to display:block so sections are block-level elements. break-inside:avoid is reliably honoured on block-level flex containers but not on flex items within a column- direction flex parent.
1 parent b86b416 commit bc5ae29

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/grigson-grille-harmonique-renderer/src/styles.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ export function getGrilleStyles(typeface: string = 'sans'): string {
2929
--cg-slash-bass-offset: 0.35em;
3030
font-family: ${fontFamily};
3131
font-size: 0.9rem;
32-
display: flex;
33-
flex-direction: column;
32+
display: block;
3433
width: fit-content;
3534
}
3635
@@ -200,6 +199,7 @@ export function getGrilleStyles(typeface: string = 'sans'): string {
200199
display: flex;
201200
align-items: center;
202201
gap: 0.75rem;
202+
break-inside: avoid;
203203
}
204204
[part~="section"] + [part~="section"] {
205205
margin-top: calc(-1 * var(--cg-grid-width));
@@ -282,5 +282,6 @@ export function getGrilleStyles(typeface: string = 'sans'): string {
282282
align-self: flex-end;
283283
transform: translateY(var(--cg-slash-bass-offset));
284284
}
285+
285286
`;
286287
}

packages/website/content/sheet.njk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ permalink: /sheet/
100100
grigson-html-renderer::part(section-label) {
101101
break-after: avoid;
102102
}
103+
103104
}
104105
</style>
105106

0 commit comments

Comments
 (0)