tfrere HF Staff commited on
Commit
0dc12f4
·
1 Parent(s): 8b7c54e

feat(layout): footer on the page grid with themed colors

Browse files
app/src/components/Footer.astro CHANGED
@@ -8,6 +8,7 @@ interface Props {
8
  }
9
  const { citationText, bibtex, licence, doi, template = "article" } = Astro.props as Props;
10
  const isPaper = template === "paper";
 
11
  ---
12
 
13
  <footer class="footer">
@@ -225,216 +226,3 @@ const isPaper = template === "paper";
225
  // No textarea auto-resize needed for <pre> blocks
226
  })();
227
  </script>
228
-
229
- <style is:global>
230
- .footer {
231
- contain: layout style;
232
- font-size: 0.8em;
233
- line-height: 1.7em;
234
- margin-top: 60px;
235
- margin-bottom: 0;
236
- border-top: 1px solid rgba(0, 0, 0, 0.1);
237
- color: rgba(0, 0, 0, 0.5);
238
- }
239
-
240
- .footer-inner {
241
- max-width: 1280px;
242
- margin: 0 auto;
243
- padding: 60px 16px 48px;
244
- display: grid;
245
- grid-template-columns: 220px minmax(0, 680px) 260px;
246
- gap: 32px;
247
- align-items: start;
248
- }
249
-
250
- /* Use the parent grid (3 columns like .content-grid) */
251
- .citation-block,
252
- .references-block,
253
- .reuse-block,
254
- .doi-block {
255
- display: contents;
256
- }
257
-
258
- .citation-block > .footer-heading,
259
- .references-block > .footer-heading,
260
- .reuse-block > .footer-heading,
261
- .doi-block > .footer-heading {
262
- grid-column: 1;
263
- font-size: 15px;
264
- font-weight: 600;
265
- margin: 0;
266
- text-align: right;
267
- padding-right: 30px;
268
- }
269
-
270
- .citation-block > :not(.footer-heading),
271
- .references-block > :not(.footer-heading),
272
- .reuse-block > :not(.footer-heading),
273
- .doi-block > :not(.footer-heading) {
274
- grid-column: 2;
275
- }
276
-
277
- .citation-block .footer-heading {
278
- margin: 0 0 8px;
279
- }
280
-
281
- .citation-block h4 {
282
- margin: 16px 0 8px;
283
- font-size: 14px;
284
- text-transform: uppercase;
285
- color: var(--muted-color);
286
- }
287
-
288
- .citation-block p,
289
- .reuse-block p,
290
- .doi-block p,
291
- .footnotes ol,
292
- .footnotes ol p,
293
- .references {
294
- margin-top: 0;
295
- }
296
-
297
- /* Preserve KaTeX rendering in footnotes - essential for math formulas */
298
- /* Compensate for footer's 0.8em font-size */
299
- .footer .footnotes .katex {
300
- font-size: 1.25em; /* 1em / 0.8em = 1.25em to compensate */
301
- line-height: 1.21;
302
- }
303
-
304
- .footer .footnotes .katex-display {
305
- margin: 1em 0;
306
- text-align: center;
307
- display: block;
308
- overflow-x: auto;
309
- overflow-y: hidden;
310
- }
311
-
312
- .footer .footnotes .katex-display > .katex {
313
- display: block;
314
- text-align: center;
315
- }
316
-
317
- /* Preserve KaTeX internal structure */
318
- .footer .footnotes .katex .katex-html {
319
- display: inline-block;
320
- }
321
-
322
- .footer .footnotes .katex .base {
323
- display: inline-block;
324
- }
325
-
326
- /* Distill-like appendix citation styling */
327
- .citation {
328
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
329
- "Liberation Mono", "Courier New", monospace;
330
- font-size: 11px;
331
- line-height: 15px;
332
- border-left: 1px solid rgba(0, 0, 0, 0.1);
333
- padding-left: 18px;
334
- border: 1px solid rgba(0, 0, 0, 0.1);
335
- background: rgba(0, 0, 0, 0.02);
336
- padding: 10px 18px;
337
- border-radius: 3px;
338
- color: rgba(150, 150, 150, 1);
339
- overflow: hidden;
340
- margin-top: -12px;
341
- white-space: pre-wrap;
342
- word-wrap: break-word;
343
- }
344
-
345
- .citation a {
346
- color: rgba(0, 0, 0, 0.6);
347
- text-decoration: underline;
348
- }
349
-
350
- .citation.short {
351
- margin-top: -4px;
352
- }
353
-
354
- .references-block .footer-heading {
355
- margin: 0;
356
- }
357
-
358
- /* Distill-like list styling for references/footnotes */
359
- .references-block ol {
360
- padding: 0 0 0 15px;
361
- }
362
-
363
- @media (min-width: 768px) {
364
- .references-block ol {
365
- padding: 0 0 0 30px;
366
- margin-left: -30px;
367
- }
368
- }
369
-
370
- .references-block li {
371
- margin-bottom: 1em;
372
- }
373
-
374
- .references-block a {
375
- color: var(--text-color);
376
- }
377
-
378
- [data-theme="dark"] .footer {
379
- border-top-color: rgba(255, 255, 255, 0.15);
380
- color: rgba(200, 200, 200, 0.8);
381
- }
382
- [data-theme="dark"] .citation {
383
- background: rgba(255, 255, 255, 0.04);
384
- border-color: rgba(255, 255, 255, 0.15);
385
- color: rgba(200, 200, 200, 1);
386
- }
387
- [data-theme="dark"] .citation a {
388
- color: rgba(255, 255, 255, 0.75);
389
- }
390
-
391
- /* Footer links: use primary color consistently */
392
- .footer a {
393
- color: var(--primary-color);
394
- border-bottom: 1px solid var(--link-underline);
395
- text-decoration: none;
396
- }
397
- .footer a:hover {
398
- color: var(--primary-color-hover);
399
- border-bottom-color: var(--link-underline-hover);
400
- }
401
- [data-theme="dark"] .footer a {
402
- color: var(--primary-color);
403
- }
404
-
405
- /* Template credit - discrete at the bottom */
406
- .template-credit {
407
- display: contents;
408
- }
409
-
410
- .template-credit p {
411
- grid-column: 2;
412
- margin: 24px 0 0 0;
413
- font-size: 0.85em;
414
- color: rgba(0, 0, 0, 0.5);
415
- }
416
-
417
- .template-credit a {
418
- color: rgba(0, 0, 0, 0.6);
419
- border-bottom: 1px solid rgba(0, 0, 0, 0.15);
420
- }
421
-
422
- .template-credit a:hover {
423
- color: rgba(0, 0, 0, 0.8);
424
- border-bottom-color: rgba(0, 0, 0, 0.3);
425
- }
426
-
427
- [data-theme="dark"] .template-credit p {
428
- color: rgba(200, 200, 200, 0.6);
429
- }
430
-
431
- [data-theme="dark"] .template-credit a {
432
- color: rgba(200, 200, 200, 0.7);
433
- border-bottom-color: rgba(255, 255, 255, 0.2);
434
- }
435
-
436
- [data-theme="dark"] .template-credit a:hover {
437
- color: rgba(200, 200, 200, 0.9);
438
- border-bottom-color: rgba(255, 255, 255, 0.35);
439
- }
440
- </style>
 
8
  }
9
  const { citationText, bibtex, licence, doi, template = "article" } = Astro.props as Props;
10
  const isPaper = template === "paper";
11
+ // Styles in src/styles/layout/_footer.css
12
  ---
13
 
14
  <footer class="footer">
 
226
  // No textarea auto-resize needed for <pre> blocks
227
  })();
228
  </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/src/styles/layout/_footer.css ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ============================================================================ */
2
+ /* Footer: headings in the TOC rail (right aligned), content in the body column */
3
+ /* ============================================================================ */
4
+
5
+ .footer {
6
+ contain: layout style;
7
+ font-size: 0.8em;
8
+ line-height: 1.7em;
9
+ margin-top: 60px;
10
+ margin-bottom: 0;
11
+ border-top: 1px solid var(--border-color);
12
+ color: var(--muted-color);
13
+ background: var(--page-bg);
14
+ }
15
+
16
+ .footer-inner {
17
+ display: grid;
18
+ grid-template-columns: var(--layout-cols);
19
+ row-gap: 28px;
20
+ padding: 60px 0 48px;
21
+ align-items: start;
22
+ }
23
+
24
+ /* Blocks flatten into the footer grid */
25
+ .citation-block,
26
+ .references-block,
27
+ .reuse-block,
28
+ .doi-block,
29
+ .template-credit {
30
+ display: contents;
31
+ }
32
+
33
+ .footer-inner > * > * {
34
+ grid-column: body;
35
+ min-width: 0;
36
+ }
37
+
38
+ .footer-inner > * > .footer-heading {
39
+ grid-column: toc;
40
+ justify-self: end;
41
+ font-size: 15px;
42
+ font-weight: 600;
43
+ margin: 0;
44
+ text-align: right;
45
+ padding-right: 30px;
46
+ color: var(--text-color);
47
+ }
48
+
49
+ @media (--bp-content-collapse) {
50
+ .footer-inner {
51
+ padding: 40px 0;
52
+ row-gap: 12px;
53
+ }
54
+
55
+ .footer-inner > * > .footer-heading {
56
+ grid-column: body;
57
+ justify-self: start;
58
+ text-align: left;
59
+ padding: 0;
60
+ margin-top: 16px;
61
+ }
62
+ }
63
+
64
+ .citation-block h4 {
65
+ margin: 16px 0 8px;
66
+ font-size: 14px;
67
+ text-transform: uppercase;
68
+ color: var(--muted-color);
69
+ }
70
+
71
+ .citation-block p,
72
+ .reuse-block p,
73
+ .doi-block p,
74
+ .footnotes ol,
75
+ .footnotes ol p,
76
+ .references {
77
+ margin-top: 0;
78
+ }
79
+
80
+ /* Preserve KaTeX rendering in footnotes (compensates the footer's 0.8em) */
81
+ .footer .footnotes .katex {
82
+ font-size: 1.25em;
83
+ line-height: 1.21;
84
+ }
85
+
86
+ .footer .footnotes .katex-display {
87
+ margin: 1em 0;
88
+ text-align: center;
89
+ display: block;
90
+ overflow-x: auto;
91
+ overflow-y: hidden;
92
+ }
93
+
94
+ .footer .footnotes .katex-display > .katex {
95
+ display: block;
96
+ text-align: center;
97
+ }
98
+
99
+ .footer .footnotes .katex .katex-html,
100
+ .footer .footnotes .katex .base {
101
+ display: inline-block;
102
+ }
103
+
104
+ /* Distill-like appendix citation styling */
105
+ .footer .citation {
106
+ font-family: var(--font-mono);
107
+ font-size: 11px;
108
+ line-height: 15px;
109
+ border: 1px solid var(--border-color);
110
+ background: var(--surface-bg);
111
+ padding: 10px 18px;
112
+ border-radius: 3px;
113
+ color: var(--muted-color);
114
+ overflow: hidden;
115
+ margin: -12px 0 0;
116
+ white-space: pre-wrap;
117
+ overflow-wrap: anywhere;
118
+ }
119
+
120
+ .footer .citation.short {
121
+ margin-top: -4px;
122
+ }
123
+
124
+ .footer .citation a {
125
+ color: var(--text-color);
126
+ text-decoration: underline;
127
+ }
128
+
129
+ /* Distill-like list styling for references / footnotes */
130
+ .references-block ol {
131
+ padding: 0 0 0 15px;
132
+ }
133
+
134
+ @media (min-width: 768px) {
135
+ .references-block ol {
136
+ padding: 0 0 0 30px;
137
+ margin-left: -30px;
138
+ }
139
+ }
140
+
141
+ .references-block li {
142
+ margin-bottom: 1em;
143
+ }
144
+
145
+ .references-block li:target {
146
+ color: var(--text-color);
147
+ background: color-mix(in srgb, var(--primary-color) 12%, transparent);
148
+ border-radius: 4px;
149
+ }
150
+
151
+ .footer a {
152
+ color: var(--primary-color);
153
+ border-bottom: 1px solid var(--link-underline);
154
+ text-decoration: none;
155
+ }
156
+
157
+ .footer a:hover {
158
+ color: var(--primary-color-hover);
159
+ border-bottom-color: var(--link-underline-hover);
160
+ }
161
+
162
+ .references-block a {
163
+ color: var(--text-color);
164
+ }
165
+
166
+ /* Template credit, discrete at the bottom */
167
+ .template-credit p {
168
+ margin: 24px 0 0;
169
+ font-size: 0.85em;
170
+ color: var(--muted-color);
171
+ }
172
+
173
+ .footer .template-credit a {
174
+ color: var(--muted-color);
175
+ border-bottom: 1px solid var(--border-color);
176
+ }
177
+
178
+ .footer .template-credit a:hover {
179
+ color: var(--text-color);
180
+ border-bottom-color: var(--muted-color);
181
+ }