Skip to content

Commit

Permalink
print CSS improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Mar 20, 2024
1 parent bf591a5 commit bdabfd9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
4 changes: 2 additions & 2 deletions css/elements.css
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ emu-eqn div:first-child {
emu-note {
margin: 1em 0;
display: flex;
gap: 1em;
flex-direction: row;
color: inherit;
border-left: 5px solid #52e052;
Expand All @@ -325,8 +326,7 @@ emu-note {
}

emu-note > span.note {
flex-basis: 100px;
min-width: 100px;
white-space: nowrap;
flex-grow: 0;
flex-shrink: 1;
text-transform: uppercase;
Expand Down
50 changes: 49 additions & 1 deletion css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ body {

p {
text-align: justify;
text-rendering: optimizeLegibility;
text-wrap: pretty;
overflow-wrap: break-word;
hyphens: auto;
orphans: 2;
widows: 2;
}

emu-note p,
emu-table td p {
text-align: left;
hyphens: manual;
overflow: hidden;
}

emu-table td,
emu-table th {
overflow-wrap: break-word;
}

emu-table table {
table-layout: auto;
width: 100%;
}

#spec-container {
Expand Down Expand Up @@ -49,15 +72,40 @@ p {
}

emu-note,
emu-table {
emu-note p,
emu-table tr,
emu-table th,
emu-table td,
emu-alg li {
break-inside: avoid;
}

emu-table thead,
h1,
figcaption,
emu-alg > ol > li:first-child {
break-after: avoid;
}

emu-grammar + emu-alg,
figcaption + emu-table,
figcaption + span[id] + emu-table,
emu-alg > ol > li:last-child {
break-before: avoid;
}

a[data-print-href]::after {
content: ' <' attr(href) '>';
color: initial;
}

emu-table thead {
display: table-header-group;
}
emu-table tfoot {
display: table-footer-group;
}

@page {
size: A4;
}
Expand Down

0 comments on commit bdabfd9

Please sign in to comment.