|
21 | 21 | Layout Containers |
22 | 22 | ========================================================================== */ |
23 | 23 |
|
24 | | - .weather-layout-vertical { |
| 24 | + & .weather-layout-vertical { |
25 | 25 | display: flex; |
26 | 26 | flex-direction: column; |
27 | 27 | gap: 1rem; |
28 | 28 | } |
29 | 29 |
|
30 | | - .weather-layout-horizontal { |
| 30 | + & .weather-layout-horizontal { |
31 | 31 | display: flex; |
32 | 32 | flex-direction: row; |
33 | 33 | gap: 1rem; |
|
38 | 38 | Forecast Table |
39 | 39 | ========================================================================== */ |
40 | 40 |
|
41 | | - .forecast-table td { |
| 41 | + & .forecast-table td { |
42 | 42 | text-align: center; |
43 | 43 | vertical-align: middle; |
44 | 44 | } |
|
47 | 47 | Layout & Structure |
48 | 48 | ========================================================================== */ |
49 | 49 |
|
50 | | - table { |
| 50 | + & table { |
51 | 51 | border-collapse: collapse; |
52 | 52 | display: inline-table; |
53 | 53 | } |
54 | 54 |
|
55 | 55 | /* Horizontal layout cell alignment */ |
56 | | - .horizontal-cell { |
| 56 | + & .horizontal-cell { |
57 | 57 | text-align: left; |
58 | 58 | } |
59 | 59 |
|
60 | 60 | /* Vertical layout row alignment */ |
61 | | - .vertical-row { |
| 61 | + & .vertical-row { |
62 | 62 | text-align: center; |
63 | 63 | } |
64 | 64 |
|
65 | 65 | /* Default layout: vertical columns */ |
66 | | - .default-column { |
| 66 | + & .default-column { |
67 | 67 | text-align: center; |
68 | 68 | vertical-align: top; |
69 | 69 | } |
70 | 70 |
|
71 | 71 | /* Common centered elements */ |
72 | | - .day, |
73 | | - .max-temp, |
74 | | - .min-temp, |
75 | | - .wind-speed { |
| 72 | + & .day, |
| 73 | + & .max-temp, |
| 74 | + & .min-temp, |
| 75 | + & .wind-speed { |
76 | 76 | text-align: center; |
77 | 77 | } |
78 | 78 |
|
79 | 79 | /* ========================================================================== |
80 | 80 | Temperature Colors |
81 | 81 | ========================================================================== */ |
82 | 82 |
|
83 | | - .colored > .max-temp, |
84 | | - .max-temp.colored { |
| 83 | + & .colored > .max-temp, |
| 84 | + & .max-temp.colored { |
85 | 85 | color: var(--color-temp-max); |
86 | 86 | } |
87 | 87 |
|
88 | | - .colored > .min-temp, |
89 | | - .min-temp.colored { |
| 88 | + & .colored > .min-temp, |
| 89 | + & .min-temp.colored { |
90 | 90 | color: var(--color-temp-min); |
91 | 91 | } |
92 | 92 |
|
93 | 93 | /* ========================================================================== |
94 | 94 | Weather Icons |
95 | 95 | ========================================================================== */ |
96 | 96 |
|
97 | | - .weathericon { |
| 97 | + & .weathericon { |
98 | 98 | display: flex; |
99 | 99 | align-items: center; |
100 | 100 | justify-content: center; |
|
103 | 103 | margin-inline: 20px; |
104 | 104 | } |
105 | 105 |
|
106 | | - .weather-icon > span > img { |
| 106 | + & .weather-icon > span > img { |
107 | 107 | min-width: 2rem; |
108 | 108 | margin: 0 var(--gap-weather-icon); |
109 | 109 | } |
110 | 110 |
|
111 | | - .forecast-icon { |
| 111 | + & .forecast-icon { |
112 | 112 | height: auto; |
113 | 113 | max-width: var(--icon-size-forecast); |
114 | 114 | display: inline; |
|
118 | 118 | Current Weather Display |
119 | 119 | ========================================================================== */ |
120 | 120 |
|
121 | | - .large-weather-icon-container { |
| 121 | + & .large-weather-icon-container { |
122 | 122 | display: flex; |
123 | 123 | align-items: center; |
124 | 124 | justify-content: center; |
125 | 125 | gap: var(--gap-icon-temp); |
126 | 126 | } |
127 | 127 |
|
128 | | - .large-weather-icon-container, |
129 | | - .wind-container { |
| 128 | + & .large-weather-icon-container, |
| 129 | + & .wind-container { |
130 | 130 | text-align: center; |
131 | 131 | } |
132 | 132 |
|
133 | 133 | /* ========================================================================== |
134 | 134 | Wind Badge |
135 | 135 | ========================================================================== */ |
136 | 136 |
|
137 | | - .wind-badge { |
| 137 | + & .wind-badge { |
138 | 138 | position: relative; |
139 | 139 | display: inline-flex; |
140 | 140 | align-items: center; |
|
143 | 143 | height: var(--wind-badge-size-medium); |
144 | 144 | min-width: var(--wind-badge-size-medium); |
145 | 145 | flex-shrink: 0; |
| 146 | + |
| 147 | + & .wind-value { |
| 148 | + position: absolute; |
| 149 | + top: 50%; |
| 150 | + left: 50%; |
| 151 | + transform: translate(-50%, -50%); |
| 152 | + font-weight: 900; |
| 153 | + font-size: 0.7em; |
| 154 | + z-index: 1; |
| 155 | + } |
146 | 156 | } |
147 | 157 |
|
148 | 158 | /* Compass wrapper (fixed size container for rotated elements) */ |
149 | | - .wind-compass { |
| 159 | + & .wind-compass { |
150 | 160 | position: relative; |
151 | 161 | width: calc(var(--wind-compass-size) + 1.4em); |
152 | 162 | height: calc(var(--wind-compass-size) + 1.4em); |
153 | 163 | flex-shrink: 0; |
154 | | - } |
155 | 164 |
|
156 | | - /* Compass circle */ |
157 | | - .wind-compass::before { |
158 | | - content: ""; |
159 | | - position: absolute; |
160 | | - top: 50%; |
161 | | - left: 50%; |
162 | | - transform: translate(-50%, -50%); |
163 | | - width: var(--wind-compass-size); |
164 | | - height: var(--wind-compass-size); |
165 | | - border: 2px solid currentcolor; |
166 | | - border-radius: 50%; |
167 | | - opacity: var(--wind-compass-opacity); |
168 | | - } |
169 | | - |
170 | | - /* Direction arrow */ |
171 | | - .wind-compass::after { |
172 | | - content: ""; |
173 | | - position: absolute; |
174 | | - top: 0.2em; |
175 | | - left: 50%; |
176 | | - transform: translateX(-50%); |
177 | | - width: 0; |
178 | | - height: 0; |
179 | | - border-left: 0.3em solid transparent; |
180 | | - border-right: 0.3em solid transparent; |
181 | | - border-bottom: 0.5em solid currentcolor; |
182 | | - opacity: var(--wind-arrow-opacity); |
183 | | - } |
184 | | - |
185 | | - /* Wind speed value */ |
186 | | - .wind-badge .wind-value { |
187 | | - position: absolute; |
188 | | - top: 50%; |
189 | | - left: 50%; |
190 | | - transform: translate(-50%, -50%); |
191 | | - font-weight: 900; |
192 | | - font-size: 0.7em; |
193 | | - z-index: 1; |
| 165 | + /* Compass circle */ |
| 166 | + &::before { |
| 167 | + content: ""; |
| 168 | + position: absolute; |
| 169 | + top: 50%; |
| 170 | + left: 50%; |
| 171 | + transform: translate(-50%, -50%); |
| 172 | + width: var(--wind-compass-size); |
| 173 | + height: var(--wind-compass-size); |
| 174 | + border: 2px solid currentcolor; |
| 175 | + border-radius: 50%; |
| 176 | + opacity: var(--wind-compass-opacity); |
| 177 | + } |
| 178 | + |
| 179 | + /* Direction arrow */ |
| 180 | + &::after { |
| 181 | + content: ""; |
| 182 | + position: absolute; |
| 183 | + top: 0.2em; |
| 184 | + left: 50%; |
| 185 | + transform: translateX(-50%); |
| 186 | + width: 0; |
| 187 | + height: 0; |
| 188 | + border-left: 0.3em solid transparent; |
| 189 | + border-right: 0.3em solid transparent; |
| 190 | + border-bottom: 0.5em solid currentcolor; |
| 191 | + opacity: var(--wind-arrow-opacity); |
| 192 | + } |
194 | 193 | } |
195 | 194 |
|
196 | 195 | /* ========================================================================== |
197 | 196 | Responsive Wind Badge Sizes |
198 | 197 | ========================================================================== */ |
199 | 198 |
|
200 | | - .small .wind-badge { |
| 199 | + & .small .wind-badge { |
201 | 200 | width: var(--wind-badge-size-small); |
202 | 201 | height: var(--wind-badge-size-small); |
| 202 | + |
| 203 | + & .wind-value { |
| 204 | + font-size: 0.65em; |
| 205 | + } |
203 | 206 | } |
204 | 207 |
|
205 | | - .medium .wind-badge { |
| 208 | + & .medium .wind-badge { |
206 | 209 | width: var(--wind-badge-size-medium); |
207 | 210 | height: var(--wind-badge-size-medium); |
| 211 | + |
| 212 | + & .wind-value { |
| 213 | + font-size: 0.7em; |
| 214 | + } |
208 | 215 | } |
209 | 216 |
|
210 | | - .large .wind-badge { |
| 217 | + & .large .wind-badge { |
211 | 218 | width: var(--wind-badge-size-large); |
212 | 219 | height: var(--wind-badge-size-large); |
213 | | - } |
214 | | - |
215 | | - /* Font size adjustments */ |
216 | | - .small .wind-badge .wind-value { |
217 | | - font-size: 0.65em; |
218 | | - } |
219 | | - |
220 | | - .medium .wind-badge .wind-value { |
221 | | - font-size: 0.7em; |
222 | | - } |
223 | 220 |
|
224 | | - .large .wind-badge .wind-value { |
225 | | - font-size: 0.75em; |
| 221 | + & .wind-value { |
| 222 | + font-size: 0.75em; |
| 223 | + } |
226 | 224 | } |
227 | 225 | } |
0 commit comments