@@ -8,6 +8,8 @@ const { title } = Astro.props;
8
8
</div >
9
9
10
10
<style lang =" scss" >
11
+ @import "../../styles/common.scss";
12
+
11
13
$dotSize: 12px;
12
14
$row-gap: 1rem;
13
15
$col-gap: 1rem;
@@ -16,11 +18,14 @@ const { title } = Astro.props;
16
18
div {
17
19
display: block;
18
20
position: relative;
19
- min-width: 50%;
20
- max-width: 50%;
21
21
padding-top: $row-gap;
22
22
}
23
23
24
+ h2 {
25
+ font-weight: 600;
26
+ font-size: 1.7rem;
27
+ }
28
+
24
29
@mixin timeline-dot {
25
30
position: absolute;
26
31
top: $row-gap;
@@ -37,36 +42,59 @@ const { title } = Astro.props;
37
42
background-color: var(--bg-color);
38
43
}
39
44
40
- div:nth-child(odd) {
41
- text-align: right;
42
- margin-left: 0;
43
- margin-right: auto;
44
- padding-right: $col-gap;
45
+ // Styling for phones: put the line on the left and put all the text on the right
46
+ @media (max-width: $tabletMinWidth) {
47
+ div {
48
+ text-align: left;
49
+ margin-left: 0.75rem;
50
+ padding-left: $col-gap;
45
51
46
- border-right: $borderWidth solid var(--timeline-color);
52
+ box-shadow: - $borderWidth 0px var(--timeline-color);
47
53
48
- &::after {
49
- @include timeline-dot();
50
- right: -$dotSize;
54
+ &::before {
55
+ @include timeline-dot();
56
+ left: -$dotSize;
57
+ }
51
58
}
52
59
}
53
60
54
- div:nth-child(even) {
55
- text-align: left;
56
- margin-left: auto;
57
- margin-right: 0;
58
- padding-left: $col-gap;
61
+ // Styling for tablets and bigger screens: put the line in the middle and put the
62
+ // text on the left and right of the line, alternating
63
+ @media (min-width: $tabletMinWidth) {
64
+ div {
65
+ display: block;
66
+ position: relative;
67
+ min-width: 50%;
68
+ max-width: 50%;
69
+ padding-top: $row-gap;
70
+ }
71
+
72
+ div:nth-child(odd) {
73
+ text-align: right;
74
+ margin-left: 0;
75
+ margin-right: auto;
76
+ padding-right: $col-gap;
59
77
60
- box-shadow: - $borderWidth 0px var(--timeline-color);
78
+ border-right: $borderWidth solid var(--timeline-color);
61
79
62
- &::before {
63
- @include timeline-dot();
64
- left: -$dotSize;
80
+ &::after {
81
+ @include timeline-dot();
82
+ right: -$dotSize;
83
+ }
65
84
}
66
- }
67
85
68
- h2 {
69
- font-weight: 600;
70
- font-size: 1.7rem;
86
+ div:nth-child(even) {
87
+ text-align: left;
88
+ margin-left: auto;
89
+ margin-right: 0;
90
+ padding-left: $col-gap;
91
+
92
+ box-shadow: -$borderWidth 0px var(--timeline-color);
93
+
94
+ &::before {
95
+ @include timeline-dot();
96
+ left: -$dotSize;
97
+ }
98
+ }
71
99
}
72
100
</style >
0 commit comments