Skip to content

Commit

Permalink
⚡ [#4255] Speed up PDF generation by replacing flexbox with float
Browse files Browse the repository at this point in the history
flexbox (as well as alternatives such as using grid or tables) are really slow in combination with weasyprint
  • Loading branch information
stevenbal committed May 24, 2024
1 parent 6821725 commit 32204e1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/openforms/scss/pdfs/_submission-step-row.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
@import '~microscope-sass/lib/typography';

.submission-step-row {
display: flex;
justify-content: flex-start;
align-items: flex-start;
page-break-inside: avoid; /* Prevent page break within rows */

& + & {
margin-top: 1mm;
Expand Down Expand Up @@ -42,12 +40,17 @@
@include body();
width: 40%;
padding-right: 2em;
// float is used here, because flexbox/grid/tables are really slow with
// weasyprint, especially if large textareas are used
// see: https://github.com/open-formulieren/open-forms/issues/4255
float: left;
}

&__value {
@include body();
width: 60%;
word-break: break-all;
margin-left: 33%;

// wysiwyg content
p {
Expand Down

0 comments on commit 32204e1

Please sign in to comment.