Skip to content

Commit d6963e5

Browse files
authored
Merge branch 'feat/train-category-expander-mobile' into feat/tags-validity
2 parents 1f80d98 + 0b2038f commit d6963e5

File tree

5 files changed

+26
-11
lines changed

5 files changed

+26
-11
lines changed

assets/sass/_variables.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ $tag-colors: (
1818
success: #155724,
1919
warning: #b64900,
2020
error: #b70000,
21-
info: #004085,
21+
info: #414141,
2222
);
2323

2424
$tag-colors-dark: (
2525
success: #a8d5ba,
2626
warning: #f0d98d,
2727
error: #f5a9ae,
28-
info: #a8d5f5,
28+
info: #d1d1d1,
2929
);
3030

3131
html {

assets/sass/tag.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.a-tag {
22
display: flex;
33
align-items: center;
4-
gap: 0.4rem;
54
padding: 0.4rem 0.8rem;
65
border-radius: var(--border-radius-s);
76
font-size: 0.7em;
@@ -16,3 +15,11 @@
1615
}
1716
}
1817
}
18+
19+
.a-tag__text {
20+
margin-left: 0.4rem;
21+
transition:
22+
opacity 0.3s ease,
23+
max-width 0.3s ease,
24+
margin-left 0.3s ease;
25+
}

assets/sass/trainCategory.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,20 @@ details.o-expander__summary--train-category {
3030
details.o-expander--train-category:not([open]) {
3131
@media (max-width: $breakpoint-md) {
3232
.a-tag__text {
33-
display: none;
33+
margin-left: 0;
34+
opacity: 0;
35+
max-width: 0;
36+
overflow: hidden;
37+
display: inline-block;
38+
}
39+
}
40+
}
41+
42+
details.o-expander--train-category[open] {
43+
@media (max-width: $breakpoint-md) {
44+
.a-tag__text {
45+
opacity: 1;
46+
max-width: 20rem;
3447
}
3548

3649
.a-tag__footnote {

content/operator/sncf/index.en.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ Reservations are mandatory on all `TGV`, almost all `IC` trains, and some region
4444
type="highspeed"
4545
fip_accepted=true
4646
reservation_required=true
47-
risk_of_confusion=true
48-
important_info=true
4947
route_overview_url="https://www.sncf-connect.com/assets/media/2021-05/2014_axes-tgv_0.pdf"
5048
%}}
5149
The `TGV` inOui is SNCF's high-speed train, connecting many cities in France and international destinations (e.g. Munich, Frankfurt am Main, Barcelona, Luxembourg, Brussels, Zurich, Milan). Each seat number exists twice in the carriage; the reserved seat is the one with the illuminated number.
@@ -74,7 +72,6 @@ Prices differ between peak and off-peak trains. The classification is not public
7472
type="highspeed"
7573
fip_accepted=false
7674
reservation_required=true
77-
risk_of_confusion=true
7875
%}}
7976

8077
The `TGV` OuiGo is SNCF's low-cost high-speed train, serving many cities in France and some international destinations.
@@ -149,7 +146,6 @@ Cost depends on route and occupancy.
149146
type="regional"
150147
fip_accepted=true
151148
reservation_required=partially
152-
risk_of_confusion=true
153149
%}}
154150
`TER` is SNCF's regional train, connecting various cities in France.
155151
Some lines from Paris require reservations, see [Reservation requirement in regional trains](#reservation-requirement-in-regional-trains).
@@ -164,7 +160,6 @@ On the Marseille – Toulon – Nice route, FIP is not valid as `TER` trains are
164160
type="regional"
165161
fip_accepted=partially
166162
reservation_possible=false
167-
important_info=true
168163
%}}
169164
RER is a suburban train operated by SNCF in Île de France (Greater Paris) and surrounding cities.
170165

layouts/shortcodes/train-category.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"fip_accepted" (default true (.Get "fip_accepted"))
55
"reservation_required" (default false (.Get "reservation_required"))
66
"reservation_possible" (default false (.Get "reservation_possible"))
7-
"risk_of_confusion" (default false (.Get "risk_of_confusion"))
8-
"important_info" (default false (.Get "important_info"))
7+
"risk_of_confusion" (strings.Contains .Inner "m-text-highlight--confusion")
8+
"important_info" (strings.Contains .Inner "m-text-highlight--important")
99
"route_overview_url" (.Get "route_overview_url")
1010
"additional_information_url" (.Get "additional_information_url")
1111
"content" (.Inner | .Page.RenderString)

0 commit comments

Comments
 (0)