Skip to content

Commit 6cfacfd

Browse files
committed
feat: Add styling for printing pages
1 parent c8186a6 commit 6cfacfd

File tree

10 files changed

+93
-11
lines changed

10 files changed

+93
-11
lines changed

assets/sass/expander.scss

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ summary {
88
}
99
}
1010

11+
.details-print {
12+
display: none;
13+
}
14+
1115
details {
1216
position: relative;
1317
padding: 1.2rem;
@@ -24,24 +28,24 @@ details > summary {
2428
list-style-type: none;
2529
}
2630

27-
details > div,
28-
summary {
31+
.details-screen > div,
32+
.details-screen > summary {
2933
margin-left: 3.2rem;
3034
}
3135

3236
details > summary::-webkit-details-marker {
3337
display: none;
3438
}
3539

36-
summary::before {
40+
.details-screen > summary::before {
3741
content: "add";
3842
position: absolute;
3943
left: 1.2rem;
4044
font-size: 2.4rem;
4145
@extend .material-symbols-rounded
4246
}
4347

44-
details[open] > summary::before {
48+
.details-screen[open] > summary::before {
4549
content: "remove";
4650
font-size: 2.4rem;
4751
@extend .material-symbols-rounded
@@ -50,3 +54,16 @@ details[open] > summary::before {
5054
details[open] > summary {
5155
font-weight: 700;
5256
}
57+
58+
59+
@media print {
60+
.details-screen {
61+
display: none;
62+
}
63+
64+
.details-print {
65+
border: solid;
66+
page-break-inside: avoid;
67+
display: block;
68+
}
69+
}

assets/sass/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
@import "form.scss";
1414
@import "expander.scss";
1515
@import "anchorlink.scss";
16+
@import "print.scss"

assets/sass/print.scss

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
@media print {
2+
body { margin: 1.6cm; }
3+
4+
a {
5+
text-decoration: none;
6+
color: var(--bs-body-color);
7+
}
8+
9+
a:not(.m-teaser) {
10+
color: var(--bs-body-color);
11+
}
12+
13+
.a-anchorlink::before {
14+
margin: 0;
15+
}
16+
17+
p {
18+
margin-bottom: 1rem;
19+
}
20+
21+
main > .container.o-single,
22+
main > .container.o-list {
23+
margin-top: 0;
24+
}
25+
26+
.o-single__container,
27+
.container,
28+
main > .container {
29+
padding: 0;
30+
}
31+
32+
.a-anchorlink__link,
33+
picture,
34+
.icon-arrow_outward,
35+
.sidemenu,
36+
.o-list__picture,
37+
.o-header__wrapper,
38+
.o-footer__links,
39+
.footnote-backref,
40+
summary::before,
41+
#search {
42+
display: none;
43+
}
44+
45+
details[open]::details-content { display: contents; }
46+
47+
a:not(.footnote-ref):not(.updateDate)::after {
48+
content: " (" attr(href) ") ";
49+
}
50+
}

content/country/denmark/index.de.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ country: "denmark"
77

88
## FIP Nutzung
99

10-
In Dänemark ist es möglich quer durch das Land auf den Hauptstrecken mit FIP 50 und FIP Freifahrtsscheinen unterwegs zu sein. Die Danske Statsbaner (DSB) [DSB]({{< ref "/operator/dsb" >}} "DSB") betreibt ein durchgehendes Netz, von denen einige Nebenstrecken abgehen, die in den meisten Fällen von privaten Bahngesellschaften (z. B. GoCollective) betrieben werden. Auf diesen wird FIP nicht anerkannt. Auch für die durch Dänemark verkehrenden Nachtzüge der Betreiber SJ und Snälltåget sind keine FIP-Vergünstigungen möglich. Ebenfalls betroffen sind die Verbindungen, die von Kopenhagen aus in Richtung Schweden verkehren.
10+
In Dänemark ist es möglich quer durch das Land auf den Hauptstrecken mit FIP 50 und FIP Freifahrtsscheinen unterwegs zu sein. Die Danske Statsbaner ([DSB]({{< ref "/operator/dsb" >}} "DSB")) betreibt ein durchgehendes Netz, von denen einige Nebenstrecken abgehen, die in den meisten Fällen von privaten Bahngesellschaften (z. B. GoCollective) betrieben werden. Auf diesen wird FIP nicht anerkannt. Auch für die durch Dänemark verkehrenden Nachtzüge der Betreiber SJ und Snälltåget sind keine FIP-Vergünstigungen möglich. Ebenfalls betroffen sind die Verbindungen, die von Kopenhagen aus in Richtung Schweden verkehren.
1111

1212
## Wissenswertes
1313

content/country/denmark/index.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ country: "denmark"
77

88
## FIP Usage
99

10-
In Denmark, it is possible to travel across the country on main routes using FIP 50 and FIP Coupon. The Danske Statsbaner (DSB) [DSB]({{< ref "/operator/dsb" >}} "DSB") operates a continuous network, with some branch lines operated by private railway companies (e.g., GoCollective) where FIP is not accepted. FIP discounts are also not available for night trains passing through Denmark operated by SJ and Snälltåget. Connections from Copenhagen towards Sweden are similarly excluded.
10+
In Denmark, it is possible to travel across the country on main routes using FIP 50 and FIP Coupon. The Danske Statsbaner ([DSB]({{< ref "/operator/dsb" >}} "DSB")) operates a continuous network, with some branch lines operated by private railway companies (e.g., GoCollective) where FIP is not accepted. FIP discounts are also not available for night trains passing through Denmark operated by SJ and Snälltåget. Connections from Copenhagen towards Sweden are similarly excluded.
1111

1212
## Interesting
1313

layouts/country/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="curtain" aria-hidden="true"></div>
55
<article class="container o-single o-single--with-sidemenu">
66
<div class="row">
7-
<div class="col-12 col-lg-4">
7+
<div class="col-12 col-lg-4 sidemenu">
88
{{ partial "sidemenu.html" . }}
99
</div>
1010

layouts/operator/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="curtain" aria-hidden="true"></div>
33
<article class="container o-single o-single--with-sidemenu">
44
<div class="row">
5-
<div class="col-12 col-lg-4">
5+
<div class="col-12 col-lg-4 sidemenu">
66
{{ partial "sidemenu.html" . }}
77
</div>
88

layouts/partials/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{ $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed") }}
88
{{ with resources.Get "sass/main.scss" }}
99
{{ $style := (resources.ExecuteAsTemplate "sass/main_templated.scss" $ .) | toCSS $options | minify }}
10-
<link rel="stylesheet" href="{{ $style.RelPermalink }}" media="screen" rel="preload" as="style" />
10+
<link rel="stylesheet" href="{{ $style.RelPermalink }}" rel="preload" as="style" />
1111
{{ end }}
1212
{{ if .IsHome }}
1313
<link rel="stylesheet" href="/pagefind/pagefind-ui.css">

layouts/partials/icon.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<span data-pagefind-ignore="all" class="material-symbols-rounded" aria-hidden="true">{{ . }}</span>
1+
<span data-pagefind-ignore="all" class="material-symbols-rounded icon-{{ . }}" aria-hidden="true">{{ . }}</span>
22
{{- /* Needed, otherwise links break: https://github.com/fipguide/fipguide.github.io/issues/116 */ -}}

layouts/shortcodes/expander.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
<details name="{{ (.Get 1) }}">
1+
<details name="{{ (.Get 1) }}" class="details-screen">
2+
<summary>
3+
{{ (.Get 0) }}
4+
</summary>
5+
<div>
6+
{{ .Inner }}
7+
</div>
8+
</details>
9+
10+
<!--
11+
Workaround for print version, otherwise the expanders would be closed.
12+
The workaround can be removed when the following issue is implemented:
13+
https://github.com/w3c/csswg-drafts/issues/2084
14+
-->
15+
<details open class="details-print">
216
<summary>
317
{{ (.Get 0) }}
418
</summary>

0 commit comments

Comments
 (0)