Skip to content

Commit 74e13df

Browse files
committed
PB-1522 : fix confederation text shrinking/covered in print view
When using a narrow layout (such as A4 portrait) the confederation text was switching to the "mobile" layout, and using a width that match only the flag.
1 parent 0dc4935 commit 74e13df

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

packages/mapviewer/src/modules/menu/components/header/ConfederationFullLogo.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ const hasDevSiteWarning = computed(() => store.getters.hasDevSiteWarning)
3636
data-cy="swiss-flag"
3737
/>
3838
<div
39-
class="swiss-confederation-text position-relative flex-column text-nowrap"
40-
:class="{ 'd-none d-lg-flex': renderForDpi === null, 'd-flex': renderForDpi !== null }"
39+
class="swiss-confederation-text position-relative flex-column"
40+
:class="{
41+
'd-none d-lg-flex': renderForDpi === null,
42+
'd-flex': renderForDpi !== null,
43+
}"
4144
data-cy="swiss-confederation-text"
4245
>
4346
<div class="d-flex flex-column">
@@ -117,14 +120,21 @@ $letterSpacing: calc((78 / 1000) * 1em);
117120
$printFontSizeRelToHeight: 0.8vh;
118121
$printFontSize: max(max($printFontSizeRelToWidth, $printFontSizeRelToHeight), $minFontSize);
119122
120-
// forcing the length of the logo to the 55mm expressed in the CD-Bund PDF guide.
121-
width: 55mm;
122-
123123
@include confederation-logo(
124124
calc(0.66 * $printFontSize),
125125
$printFontSize,
126126
calc(1.2 * $printFontSize)
127127
);
128+
129+
.swiss-confederation-text {
130+
/* Prevent shrinking and ensure the width matches the content */
131+
flex: 0 0 auto;
132+
width: fit-content;
133+
}
134+
& {
135+
// ensuring the logo and text have enough space
136+
width: 100%;
137+
}
128138
}
129139
130140
.swiss-flag {

packages/mapviewer/src/views/PrintView.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async function generateShareLink() {
143143
:style="printContainerStyle"
144144
>
145145
<MapModule class="flex-grow-1">
146-
<div class="north-arrow position-absolute top-0 end-0 m-4 m-xl-5 z-3">
146+
<div class="north-arrow position-absolute m-xl-5 z-3 end-0 top-0 m-4">
147147
<img
148148
src="@/modules/map/assets/north_arrow.png"
149149
:style="northArrowStyle"
@@ -156,7 +156,7 @@ async function generateShareLink() {
156156
<template #top-right>
157157
<div
158158
v-if="shortLink"
159-
class="print-scale-line d-flex flex-column m-2 me-3 me-xl-3 bg-white p-3 border border-2 border-black"
159+
class="print-scale-line d-flex flex-column me-xl-3 m-2 me-3 border border-2 border-black bg-white p-3"
160160
>
161161
<div class="scale d-flex justify-content-center m-1 mb-3">
162162
<OpenLayersScale
@@ -192,7 +192,7 @@ async function generateShareLink() {
192192
<img
193193
v-if="shortLink"
194194
:src="qrCodeUrl"
195-
class="qr-code position-relative bottom-0 end-0 z-3 bg-white p-2 m-n1"
195+
class="qr-code position-relative z-3 m-n1 bottom-0 end-0 bg-white p-2"
196196
alt="QR Code"
197197
/>
198198
</template>
@@ -202,9 +202,9 @@ async function generateShareLink() {
202202
</MapFooter>
203203
</template>
204204
</MapModule>
205-
<div class="print-footer d-flex pt-3 px-3 pb-1 gap-3">
205+
<div class="print-footer d-flex gap-3 p-1">
206206
<ConfederationFullLogo :render-for-dpi="printDPI" />
207-
<div class="print-disclaimer flew-grow-1 px-1 px-md-3 px-xl-5 d-flex flex-column">
207+
<div class="print-disclaimer flex-grow-1 px-md-3 px-xl-5 d-flex flex-column px-1">
208208
<span class="text-justify">{{ t('print_footer_description') }}</span>
209209
<span class="text-justify">{{ t('print_footer_disclaimer') }}</span>
210210
<span class="mt-1">&copy; swisstopo</span>

0 commit comments

Comments
 (0)