From ff2c383f216084d28aa62c82d8d359f590247124 Mon Sep 17 00:00:00 2001 From: Benjamin Dehli Date: Fri, 2 Feb 2024 15:54:29 +0100 Subject: [PATCH] Adjust PDF headings --- src/stories/PDF.scss | 33 +++++++++++++++++++++++++++--- src/stories/PDF.stories.jsx | 40 +++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 25 deletions(-) diff --git a/src/stories/PDF.scss b/src/stories/PDF.scss index 0520352d..1aaa3cf8 100644 --- a/src/stories/PDF.scss +++ b/src/stories/PDF.scss @@ -7,6 +7,7 @@ $font-size-h2: 24px; $font-size-h2-small: 16px; $font-size-h3: 19px; $font-size-h4: 17px; +$font-size-h5: 16px; $font-size-table-header: 15px; $font-size-table-data: 16px; $font-size-checkbox: 20px; @@ -25,6 +26,8 @@ $margin-top-h3: 15px; $margin-bottom-h3: 4px; $margin-top-h4: 15px; $margin-bottom-h4: 6px; +$margin-top-h5: 12px; +$margin-bottom-h5: 2px; $margin-top-paragraph: 3px; $margin-bottom-paragraph: 12px; $margin-top-list: 3px; @@ -183,6 +186,15 @@ body { } } + h5, + .h5 { + page-break-after: avoid; + font-size: $font-size-h5; + font-weight: bold; + margin-top: $margin-top-h5; + margin-bottom: $margin-bottom-h5; + } + p { margin-top: $margin-top-paragraph; margin-bottom: $margin-bottom-paragraph; @@ -399,14 +411,16 @@ body { float: right; margin-left: calc($heading-logo-margin-left * $scaling-for-signed-documents); } - h1 { + h1, + .h1 { font-size: calc($font-size-h1 * $scaling-for-signed-documents); margin-top: calc($margin-top-h1 * $scaling-for-signed-documents); small { font-size: calc($font-size-h1-small * $scaling-for-signed-documents); } } - h2 { + h2, + .h2 { font-size: calc($font-size-h2 * $scaling-for-signed-documents); margin-top: calc($margin-top-h2 * $scaling-for-signed-documents); margin-bottom: calc($margin-bottom-h2 * $scaling-for-signed-documents); @@ -415,11 +429,24 @@ body { margin-bottom: calc($margin-bottom-h2-small * $scaling-for-signed-documents); } } - h3 { + h3, + .h3 { font-size: calc($font-size-h3 * $scaling-for-signed-documents); margin-top: calc($margin-top-h3 * $scaling-for-signed-documents); margin-bottom: calc($margin-bottom-h3 * $scaling-for-signed-documents); } + h4, + .h4 { + font-size: calc($font-size-h4 * $scaling-for-signed-documents); + margin-top: calc($margin-top-h4 * $scaling-for-signed-documents); + margin-bottom: calc($margin-bottom-h4 * $scaling-for-signed-documents); + } + h5, + .h5 { + font-size: calc($font-size-h5 * $scaling-for-signed-documents); + margin-top: calc($margin-top-h5 * $scaling-for-signed-documents); + margin-bottom: calc($margin-bottom-h5 * $scaling-for-signed-documents); + } p { margin-top: calc($margin-top-paragraph * $scaling-for-signed-documents); margin-bottom: calc($margin-bottom-paragraph * $scaling-for-signed-documents); diff --git a/src/stories/PDF.stories.jsx b/src/stories/PDF.stories.jsx index b88359cd..ad347ed3 100644 --- a/src/stories/PDF.stories.jsx +++ b/src/stories/PDF.stories.jsx @@ -48,12 +48,18 @@ const h1Example = ( ); -const h2Example =

Heading level 2 example

; +const h2Example = ( +

+ Heading level 2 example small text example +

+); const h3Example =

Heading level 3 example

; const h4Example =

Heading level 4 example

; +const h5Example =
Heading level 5 example
; + const textParagraphsExample = ( <>

@@ -203,28 +209,18 @@ Logo.args = { children: logoExample }; -export const H1 = Template.bind({}); -H1.args = { - signedDocument: false, - children: h1Example -}; - -export const H2 = Template.bind({}); -H2.args = { - signedDocument: false, - children: h2Example -}; - -export const H3 = Template.bind({}); -H3.args = { +export const Headings = Template.bind({}); +Headings.args = { signedDocument: false, - children: h3Example -}; - -export const H4 = Template.bind({}); -H4.args = { - signedDocument: false, - children: h4Example + children: ( + <> + {h1Example} + {h2Example} + {h3Example} + {h4Example} + {h5Example} + + ) }; export const Text = Template.bind({});