From 32204e13c40e424c1be717471783b15c454459d2 Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Fri, 24 May 2024 12:42:52 +0200 Subject: [PATCH] :zap: [#4255] Speed up PDF generation by replacing flexbox with float flexbox (as well as alternatives such as using grid or tables) are really slow in combination with weasyprint --- src/openforms/scss/pdfs/_submission-step-row.scss | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openforms/scss/pdfs/_submission-step-row.scss b/src/openforms/scss/pdfs/_submission-step-row.scss index d75ca56b04..06fef4267a 100644 --- a/src/openforms/scss/pdfs/_submission-step-row.scss +++ b/src/openforms/scss/pdfs/_submission-step-row.scss @@ -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; @@ -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 {