Skip to content

Commit d17c62a

Browse files
committed
refactor: Clean up CSS
1 parent 8ed82f3 commit d17c62a

File tree

4 files changed

+60
-88
lines changed

4 files changed

+60
-88
lines changed

assets/sass/expander.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}
4848
}
4949

50-
> div {
50+
&-title {
5151
display: flex;
5252
align-items: center;
5353
gap: 0.5rem;

assets/sass/trainCategory.scss

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,15 @@
11
.o-train-category__header {
22
width: 100%;
3-
4-
&-content {
5-
display: flex;
6-
flex-direction: column;
7-
gap: 0.8rem;
8-
width: 100%;
9-
}
10-
}
11-
12-
.o-train-category__title-wrapper {
13-
width: 100%;
3+
display: flex;
4+
flex-direction: column;
5+
gap: 0.8rem;
146
}
157

168
.o-train-category__title {
179
display: flex;
1810
align-items: center;
1911
gap: 0.5rem;
2012
font-weight: 600;
21-
font-size: 1.6rem;
22-
23-
&-text {
24-
flex: 1;
25-
}
2613
}
2714

2815
.o-train-category__tags {
@@ -50,10 +37,6 @@
5037
}
5138
}
5239

53-
.o-train-category__content {
54-
margin-top: 1rem;
55-
}
56-
5740
.o-expander__summary--train-category {
5841
&:hover,
5942
&:focus {
Lines changed: 55 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,67 @@
11
<summary class="o-expander__summary o-expander__summary--train-category">
22
<div class="o-train-category__header">
3-
<div class="o-train-category__header-content">
4-
<div class="o-train-category__title-wrapper">
5-
<div class="o-train-category__title">
6-
{{- partial "icon" "train" -}}
7-
<span class="o-train-category__title-text">{{- .title -}}</span>
8-
</div>
9-
</div>
10-
<div class="o-train-category__tags">
11-
{{- if eq .fip_accepted true -}}
12-
<span class="o-train-category__tag o-train-category__tag--success">
13-
{{ partial "icon" "check_circle" }}
14-
FIP Accepted
15-
</span>
16-
{{- else if eq .fip_accepted "partially" -}}
17-
<span class="o-train-category__tag o-train-category__tag--warning">
18-
{{ partial "icon" "info" }}
19-
FIP Partially Accepted
20-
</span>
21-
{{- else -}}
22-
<span class="o-train-category__tag o-train-category__tag--error">
23-
{{ partial "icon" "dangerous" }}
24-
FIP Not Accepted
25-
</span>
26-
{{- end -}}
3+
<div class="o-train-category__title">
4+
{{- partial "icon" "train" -}}
5+
<span class="o-train-category__title-text">{{- .title -}}</span>
6+
</div>
7+
<div class="o-train-category__tags">
8+
{{- if eq .fip_accepted true -}}
9+
<span class="o-train-category__tag o-train-category__tag--success">
10+
{{ partial "icon" "check_circle" }}
11+
FIP Accepted
12+
</span>
13+
{{- else if eq .fip_accepted "partially" -}}
14+
<span class="o-train-category__tag o-train-category__tag--warning">
15+
{{ partial "icon" "info" }}
16+
FIP Partially Accepted
17+
</span>
18+
{{- else -}}
19+
<span class="o-train-category__tag o-train-category__tag--error">
20+
{{ partial "icon" "dangerous" }}
21+
FIP Not Accepted
22+
</span>
23+
{{- end -}}
2724

28-
{{- if eq .reservation_required true -}}
29-
<span class="o-train-category__tag o-train-category__tag--error">
30-
{{ partial "icon" "calendar_add_on" }}
31-
Reservation Required
32-
</span>
33-
{{- else if eq .reservation_required true -}}
34-
<span class="o-train-category__tag o-train-category__tag--warning">
35-
{{ partial "icon" "calendar_add_on" }}
36-
Reservation Partially Required
37-
</span>
38-
{{- else if eq .reservation_possible true -}}
39-
<span class="o-train-category__tag o-train-category__tag--info">
40-
{{ partial "icon" "calendar_check" }}
41-
Reservation Possible
42-
</span>
43-
{{- else -}}
44-
<span class="o-train-category__tag o-train-category__tag--info">
45-
{{ partial "icon" "calendar_lock" }}
46-
No Reservation Possible
47-
</span>
48-
{{- end -}}
25+
{{- if eq .reservation_required true -}}
26+
<span class="o-train-category__tag o-train-category__tag--error">
27+
{{ partial "icon" "calendar_add_on" }}
28+
Reservation Required
29+
</span>
30+
{{- else if eq .reservation_required true -}}
31+
<span class="o-train-category__tag o-train-category__tag--warning">
32+
{{ partial "icon" "calendar_add_on" }}
33+
Reservation Partially Required
34+
</span>
35+
{{- else if eq .reservation_possible true -}}
36+
<span class="o-train-category__tag o-train-category__tag--info">
37+
{{ partial "icon" "calendar_check" }}
38+
Reservation Possible
39+
</span>
40+
{{- else -}}
41+
<span class="o-train-category__tag o-train-category__tag--info">
42+
{{ partial "icon" "calendar_lock" }}
43+
No Reservation Possible
44+
</span>
45+
{{- end -}}
4946

50-
{{- if .risk_of_confusion -}}
51-
<span class="o-train-category__tag o-train-category__tag--warning">
52-
{{ partial "icon" "question_exchange" }}
53-
Risk of confusion
54-
</span>
55-
{{- end -}}
47+
{{- if .risk_of_confusion -}}
48+
<span class="o-train-category__tag o-train-category__tag--warning">
49+
{{ partial "icon" "question_exchange" }}
50+
Risk of confusion
51+
</span>
52+
{{- end -}}
5653

57-
{{- if .important_info -}}
58-
<span class="o-train-category__tag o-train-category__tag--warning">
59-
{{ partial "icon" "campaign" }}
60-
Important information
61-
</span>
62-
{{- end -}}
63-
</div>
54+
{{- if .important_info -}}
55+
<span class="o-train-category__tag o-train-category__tag--warning">
56+
{{ partial "icon" "campaign" }}
57+
Important information
58+
</span>
59+
{{- end -}}
6460
</div>
6561
</div>
6662
{{- partial "icon" "keyboard_arrow_down" -}}
6763
</summary>
6864
<hr aria-hidden="true" />
6965
<div class="o-expander__content">
70-
{{- if .content -}}
71-
<div class="o-train-category__content">
72-
{{- .content -}}
73-
</div>
74-
{{- end -}}
75-
{{- if not (eq .fip_accepted true) -}}
76-
<span>FIP is not accepted for this train category!</span>
77-
{{- end -}}
66+
{{- .content -}}
7867
</div>

layouts/shortcodes/expander.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<details name="{{ (.Get 2) }}" class="o-expander">
66
<summary class="o-expander__summary">
7-
<div>
7+
<div class="o-expander__summary-title">
88
{{- partial "icon" (index $iconMapping $param) -}}
99
<span class="o-expander__summary-text">{{ (.Get 0) }}</span>
1010
</div>

0 commit comments

Comments
 (0)