tfrere HF Staff commited on
Commit
dc3e126
·
1 Parent(s): d134b97

fix: improve mobile banner layout and PDF print styles

Browse files

- Move hero description outside overflow:hidden banner container
- Use auto aspect-ratio on mobile to prevent banner truncation
- Add break-inside:avoid for Stack, cards, palettes, color-picker, notes
- Remove link backgrounds and force --surface-bg to white in print
- Remove card box-shadow in print to prevent gray artifacts

Made-with: Cursor

app/src/components/Hero.astro CHANGED
@@ -99,8 +99,8 @@ const pdfFilename = `${slugify(pdfBase)}.pdf`;
99
  <h1 class="hero-title" set:html={title} />
100
  <div class="hero-banner">
101
  <HtmlEmbed src="banner.html" frameless />
102
- {description && <p class="hero-desc">{description}</p>}
103
  </div>
 
104
  </section>
105
 
106
  <header class="meta" aria-label="Article meta information">
@@ -426,6 +426,9 @@ const pdfFilename = `${slugify(pdfBase)}.pdf`;
426
  }
427
 
428
  @media (max-width: 768px) {
 
 
 
429
  .hero-desc {
430
  max-width: 90%;
431
  }
 
99
  <h1 class="hero-title" set:html={title} />
100
  <div class="hero-banner">
101
  <HtmlEmbed src="banner.html" frameless />
 
102
  </div>
103
+ {description && <p class="hero-desc">{description}</p>}
104
  </section>
105
 
106
  <header class="meta" aria-label="Article meta information">
 
426
  }
427
 
428
  @media (max-width: 768px) {
429
+ .hero-banner {
430
+ aspect-ratio: auto;
431
+ }
432
  .hero-desc {
433
  max-width: 90%;
434
  }
app/src/styles/_print.css CHANGED
@@ -18,9 +18,10 @@
18
  display: none !important;
19
  }
20
 
21
- /* Links: remove underline */
22
  .content-grid main a {
23
  text-decoration: none;
 
24
  border-bottom: 1px solid rgba(0, 0, 0, .2);
25
  }
26
 
@@ -47,6 +48,7 @@
47
 
48
  /* Adjust more contrasty colors for print */
49
  :root {
 
50
  --border-color: rgba(0, 0, 0, .2);
51
  --link-underline: rgba(0, 0, 0, .3);
52
  --link-underline-hover: rgba(0, 0, 0, .4);
@@ -79,7 +81,13 @@
79
  table,
80
  blockquote,
81
  .wide,
82
- .full-width {
 
 
 
 
 
 
83
  break-inside: avoid;
84
  page-break-inside: avoid;
85
  }
 
18
  display: none !important;
19
  }
20
 
21
+ /* Links: remove underline and background */
22
  .content-grid main a {
23
  text-decoration: none;
24
+ background: none;
25
  border-bottom: 1px solid rgba(0, 0, 0, .2);
26
  }
27
 
 
48
 
49
  /* Adjust more contrasty colors for print */
50
  :root {
51
+ --surface-bg: #fff;
52
  --border-color: rgba(0, 0, 0, .2);
53
  --link-underline: rgba(0, 0, 0, .3);
54
  --link-underline-hover: rgba(0, 0, 0, .4);
 
81
  table,
82
  blockquote,
83
  .wide,
84
+ .full-width,
85
+ .stack > *,
86
+ .card,
87
+ .palettes,
88
+ .palette-card,
89
+ .color-picker,
90
+ .note {
91
  break-inside: avoid;
92
  page-break-inside: avoid;
93
  }
app/src/styles/components/_card.css CHANGED
@@ -123,4 +123,11 @@
123
  color: var(--muted-color);
124
  font-size: 0.9rem;
125
  margin: 0 !important;
 
 
 
 
 
 
 
126
  }
 
123
  color: var(--muted-color);
124
  font-size: 0.9rem;
125
  margin: 0 !important;
126
+ }
127
+
128
+ @media print {
129
+ .card,
130
+ .card-cta {
131
+ box-shadow: none;
132
+ }
133
  }