|
1 | 1 | .food-tracker-total { |
2 | 2 | position: sticky; |
3 | 3 | bottom: 0; |
4 | | - background-color: var(--background-primary); |
| 4 | + background-color: var(--background-secondary); |
5 | 5 | border-top: 1px solid var(--background-modifier-border); |
6 | 6 | padding: 8px 16px; |
7 | 7 | font-size: 0.9em; |
8 | | - z-index: 100; |
| 8 | + z-index: 1000; |
9 | 9 | margin-top: 8px; |
10 | 10 | } |
11 | 11 |
|
|
14 | 14 | transition: |
15 | 15 | width 0.3s ease-in-out, |
16 | 16 | max-width 0.3s ease-in-out; |
17 | | - width: 490px; |
18 | | - max-width: 490px; |
| 17 | + width: min(490px, 90vw); |
| 18 | + max-width: min(490px, 90vw); |
19 | 19 | } |
20 | 20 |
|
21 | 21 | .nutrient-modal-expanded { |
22 | | - width: 920px; |
23 | | - max-width: 920px; |
| 22 | + width: min(920px, 95vw); |
| 23 | + max-width: min(920px, 95vw); |
24 | 24 | } |
25 | 25 |
|
26 | 26 | .nutrient-modal .modal-content { |
|
35 | 35 |
|
36 | 36 | .nutrient-form-container { |
37 | 37 | flex: 0 0 450px; |
38 | | - min-width: 450px; |
| 38 | + max-width: 450px; |
| 39 | + min-width: min(450px, 50vw); |
39 | 40 | padding-right: 20px; |
40 | 41 | } |
41 | 42 |
|
42 | 43 | .search-results-container { |
43 | | - flex: 0 0 400px; |
44 | | - min-width: 400px; |
| 44 | + flex: 1; |
| 45 | + min-width: min(300px, 40vw); |
| 46 | + max-width: 500px; |
| 47 | + display: flex; |
| 48 | + flex-direction: column; |
| 49 | + align-self: flex-start; |
| 50 | + height: 100%; |
45 | 51 | } |
46 | 52 |
|
47 | | -.search-results-container:not([style*="display: none"]) { |
48 | | - opacity: 0; |
| 53 | +.search-results-container.is-visible { |
49 | 54 | animation: fadeInRight 0.4s ease-out 0.2s forwards; |
50 | 55 | } |
51 | 56 |
|
|
60 | 65 | } |
61 | 66 | } |
62 | 67 |
|
| 68 | +.search-results { |
| 69 | + height: 100%; |
| 70 | + min-height: 400px; |
| 71 | + overflow-y: auto; |
| 72 | +} |
| 73 | + |
63 | 74 | .search-results h3 { |
64 | 75 | margin-bottom: 12px; |
65 | 76 | color: var(--text-accent); |
|
108 | 119 | } |
109 | 120 |
|
110 | 121 | .food-value { |
111 | | - background-color: var(--interactive-accent); |
112 | | - color: var(--text-on-accent); |
| 122 | + background-color: rgba(var(--color-purple-rgb), 0.5); |
| 123 | + color: var(--text-on-accent-inverted); |
113 | 124 | border-radius: 4px; |
114 | 125 | padding: 0 4px; |
115 | 126 | } |
116 | 127 |
|
117 | 128 | .food-nutrition-value { |
118 | | - background-color: var(--interactive-accent-hover); |
119 | | - color: var(--text-on-accent); |
| 129 | + background-color: rgba(var(--color-blue-rgb), 0.5); |
| 130 | + color: var(--text-on-accent-inverted); |
120 | 131 | border-radius: 4px; |
121 | 132 | padding: 0 4px; |
122 | 133 | } |
|
133 | 144 | text-align: center; |
134 | 145 | } |
135 | 146 |
|
136 | | -.ft-progress { |
137 | | - --ft-progress-percent: 0%; |
138 | | - --ft-progress-color: var(--interactive-accent); |
| 147 | +.food-tracker-progress { |
| 148 | + --food-tracker-progress-percent: 0%; |
| 149 | + --food-tracker-progress-color: var(--background-primary); |
139 | 150 | background-image: linear-gradient( |
140 | 151 | to right, |
141 | | - var(--ft-progress-color) var(--ft-progress-percent), |
142 | | - transparent var(--ft-progress-percent) |
| 152 | + var(--food-tracker-progress-color) var(--food-tracker-progress-percent), |
| 153 | + transparent var(--food-tracker-progress-percent) |
143 | 154 | ); |
144 | 155 | border-radius: 4px; |
145 | 156 | padding: 0 4px; |
146 | | - color: var(--text-normal); |
147 | 157 | } |
148 | 158 |
|
149 | | -.ft-nutrition-bar { |
| 159 | +.food-tracker-nutrition-bar { |
150 | 160 | display: flex; |
151 | 161 | align-items: center; |
152 | 162 | border: 1px solid var(--background-modifier-border); |
|
157 | 167 | max-width: fit-content; |
158 | 168 | } |
159 | 169 |
|
160 | | -.ft-icon { |
161 | | - color: var(--interactive-accent); |
162 | | - flex-shrink: 0; |
163 | | - margin-left: 4px; |
164 | | - margin-right: 6px; |
165 | | - cursor: help; |
| 170 | +/* Reusable tooltip utility class */ |
| 171 | +.food-tracker-tooltip-host { |
166 | 172 | position: relative; |
167 | | - display: inline-flex; |
168 | | - align-items: center; |
| 173 | + cursor: help; |
169 | 174 | } |
170 | 175 |
|
171 | | -.ft-icon::after { |
172 | | - content: attr(title); |
| 176 | +.food-tracker-tooltip-host::after { |
| 177 | + content: attr(data-tooltip); |
173 | 178 | position: absolute; |
174 | 179 | bottom: 100%; |
175 | 180 | left: 50%; |
|
189 | 194 | margin-bottom: 4px; |
190 | 195 | } |
191 | 196 |
|
192 | | -.ft-icon:hover::after { |
| 197 | +.food-tracker-tooltip-host:hover::after { |
193 | 198 | opacity: 1; |
194 | 199 | } |
195 | 200 |
|
196 | | -.ft-nutrient-item { |
| 201 | +.food-tracker-icon { |
| 202 | + color: var(--interactive-accent); |
| 203 | + flex-shrink: 0; |
| 204 | + margin-left: 4px; |
| 205 | + margin-right: 6px; |
| 206 | + display: inline-flex; |
| 207 | + align-items: center; |
| 208 | +} |
| 209 | + |
| 210 | +.food-tracker-nutrient-item { |
197 | 211 | display: flex; |
198 | 212 | align-items: center; |
199 | 213 | justify-content: center; |
|
203 | 217 | padding: 0; |
204 | 218 | border: none; |
205 | 219 | background-color: transparent; |
206 | | - cursor: help; |
207 | | - position: relative; |
208 | | -} |
209 | | - |
210 | | -.ft-nutrient-item::after { |
211 | | - content: attr(title); |
212 | | - position: absolute; |
213 | | - bottom: 100%; |
214 | | - left: 50%; |
215 | | - transform: translateX(-50%); |
216 | | - background-color: var(--background-primary); |
217 | | - color: var(--text-normal); |
218 | | - padding: 4px 8px; |
219 | | - border-radius: 4px; |
220 | | - font-size: 12px; |
221 | | - white-space: nowrap; |
222 | | - opacity: 0; |
223 | | - pointer-events: none; |
224 | | - transition: opacity 0.2s; |
225 | | - z-index: 1000; |
226 | | - border: 1px solid var(--background-modifier-border); |
227 | | - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); |
228 | | - margin-bottom: 4px; |
229 | | -} |
230 | | - |
231 | | -.ft-nutrient-item:hover::after { |
232 | | - opacity: 1; |
233 | 220 | } |
234 | 221 |
|
235 | | -.ft-separator { |
| 222 | +.food-tracker-separator { |
236 | 223 | width: 1px; |
237 | 224 | height: 20px; |
238 | 225 | background-color: var(--background-modifier-border); |
239 | 226 | flex-shrink: 0; |
240 | 227 | } |
241 | 228 |
|
242 | | -.ft-progress-green { |
243 | | - --ft-progress-color: var(--color-green, #3a9f4c); |
| 229 | +.food-tracker-progress-green { |
| 230 | + --food-tracker-progress-color: var(--color-green, #3a9f4c); |
244 | 231 | } |
245 | 232 |
|
246 | | -.ft-progress-yellow { |
247 | | - --ft-progress-color: var(--color-yellow, #d8a000); |
| 233 | +.food-tracker-progress-yellow { |
| 234 | + --food-tracker-progress-color: var(--color-yellow, #d8a000); |
248 | 235 | } |
249 | 236 |
|
250 | | -.ft-progress-red { |
251 | | - --ft-progress-color: var(--color-red, #d84c4c); |
| 237 | +.food-tracker-progress-red { |
| 238 | + --food-tracker-progress-color: var(--color-red, #d84c4c); |
252 | 239 | } |
253 | 240 |
|
254 | 241 | .goals-value { |
255 | | - background-color: var(--color-blue); |
256 | | - color: var(--text-on-accent); |
| 242 | + background-color: rgba(var(--color-green-rgb), 0.5); |
| 243 | + color: var(--text-on-accent-inverted); |
257 | 244 | border-radius: 4px; |
258 | 245 | padding: 0 4px; |
259 | 246 | } |
0 commit comments