Skip to content

Commit 75f32dd

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 627dfe0 commit 75f32dd

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
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: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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 p-1 gap-3">
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-1 px-md-3 px-xl-5 d-flex flex-column">
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>
@@ -229,10 +229,6 @@ $printFontSize: max(max($printFontSizeRelToWidth, $printFontSizeRelToHeight), $m
229229
.print-scale-line {
230230
font-size: $printFontSize;
231231
}
232-
.swiss-flag {
233-
width: auto;
234-
height: calc(3 * $printFontSize);
235-
}
236232
.north-arrow {
237233
$dropShadowSize: calc(0.5 * $printFontSize);
238234
filter: drop-shadow($dropShadowSize $dropShadowSize $dropShadowSize #222);

0 commit comments

Comments
 (0)