ferst-core 0.9.3 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -212,6 +212,7 @@ collections:
212
212
  search_fields: [label]
213
213
  multiple: true
214
214
  - { name: heroImage, label: Hero image, widget: image, required: false }
215
+ - { name: heroImageAlt, label: Picture description, widget: string, required: false, hint: "Who or what the picture shows, in a short sentence, for people who can't see it (e.g. Parishioners outside the church after the Easter Vigil). Leave empty if it's only decoration." }
215
216
  - { name: attachment, label: Attachment (e.g. PDF), widget: file, required: false }
216
217
  - { name: draft, label: Draft, widget: boolean, default: false, required: false }
217
218
  - { name: body, label: Body, widget: markdown, required: false }
@@ -94,13 +94,13 @@ const {
94
94
  .btn--primary {
95
95
  background: var(--gold);
96
96
  border-color: var(--gold);
97
- color: var(--text-light);
97
+ color: var(--on-brand);
98
98
  }
99
99
  .btn--primary:hover,
100
100
  .btn--primary:focus-visible {
101
101
  background: color-mix(in srgb, var(--gold) 85%, #000);
102
102
  border-color: color-mix(in srgb, var(--gold) 85%, #000);
103
- color: var(--text-light);
103
+ color: var(--on-brand);
104
104
  }
105
105
  .btn--primary:focus-visible {
106
106
  outline: 2px solid var(--gold);
@@ -122,7 +122,7 @@ const {
122
122
  darkens the accent via color-mix, which works for any brand colour. */
123
123
  .btn--cta {
124
124
  background: var(--gold);
125
- color: var(--text-light);
125
+ color: var(--on-brand);
126
126
  border: none;
127
127
  border-radius: 8px;
128
128
  font-family: var(--font-body);
@@ -145,11 +145,11 @@ const {
145
145
 
146
146
  .btn--cta:hover {
147
147
  background: color-mix(in srgb, var(--gold) 85%, #000);
148
- color: var(--text-light);
148
+ color: var(--on-brand);
149
149
  }
150
150
  .btn--cta:focus-visible {
151
151
  background: color-mix(in srgb, var(--gold) 85%, #000);
152
- color: var(--text-light);
152
+ color: var(--on-brand);
153
153
  outline: 2px solid var(--gold);
154
154
  outline-offset: 2px;
155
155
  }
@@ -161,7 +161,7 @@ const {
161
161
  margin-top: auto;
162
162
  align-self: var(--content-self, flex-start);
163
163
  background: var(--gold);
164
- color: var(--text-light);
164
+ color: var(--on-brand);
165
165
  border: none;
166
166
  border-radius: 8px;
167
167
  font-family: var(--font-body);
@@ -184,11 +184,11 @@ const {
184
184
 
185
185
  .btn--compact:hover {
186
186
  background: color-mix(in srgb, var(--gold) 85%, #000);
187
- color: var(--text-light);
187
+ color: var(--on-brand);
188
188
  }
189
189
  .btn--compact:focus-visible {
190
190
  background: color-mix(in srgb, var(--gold) 85%, #000);
191
- color: var(--text-light);
191
+ color: var(--on-brand);
192
192
  outline: 2px solid var(--gold);
193
193
  outline-offset: 2px;
194
194
  }
@@ -171,7 +171,7 @@ const safe = isSafeEmbedUrl(finalEmbedUrl);
171
171
  border: none;
172
172
  border-radius: var(--radius-sm);
173
173
  background: var(--gold);
174
- color: var(--text-light);
174
+ color: var(--on-brand);
175
175
  cursor: pointer;
176
176
  transition: filter 0.15s ease;
177
177
  }
@@ -120,7 +120,7 @@ const { policyHref = '/cookie-policy/' } = Astro.props;
120
120
  .cookie-banner__btn--primary {
121
121
  border: none;
122
122
  background: var(--gold);
123
- color: var(--text-light);
123
+ color: var(--on-brand);
124
124
  }
125
125
  .cookie-banner__btn--primary:hover { filter: brightness(0.94); }
126
126
  .cookie-banner__btn--ghost {
@@ -10,6 +10,8 @@ interface Props {
10
10
  title: string;
11
11
  date: Date | string;
12
12
  heroImage?: string;
13
+ /** What the picture shows (its alt text); empty leaves it as decoration. */
14
+ heroImageAlt?: string;
13
15
  /** Optional downloadable file (e.g. a PDF newsletter) shown as a download link. */
14
16
  attachment?: string;
15
17
  /** Resolved tags for display + linking. */
@@ -20,7 +22,7 @@ interface Props {
20
22
  backHref?: string;
21
23
  backLabel?: string;
22
24
  }
23
- const { title, date, heroImage, attachment, tags = [], tagBase = '/tags', backHref, backLabel = 'Back to news' } = Astro.props;
25
+ const { title, date, heroImage, heroImageAlt = '', attachment, tags = [], tagBase = '/tags', backHref, backLabel = 'Back to news' } = Astro.props;
24
26
  // A human label for the download link, hinting the file type from its extension.
25
27
  const attachmentExt = attachment ? attachment.split('.').pop()?.toUpperCase() : undefined;
26
28
  const attachmentLabel = attachmentExt && attachmentExt.length <= 4 ? `Download (${attachmentExt})` : 'Download attachment';
@@ -47,7 +49,7 @@ const display = Number.isNaN(d.valueOf())
47
49
  </ul>
48
50
  )}
49
51
  </div>
50
- {heroImage && <img class="b-post__hero" src={heroImage} alt="" />}
52
+ {heroImage && <img class="b-post__hero" src={heroImage} alt={heroImageAlt} />}
51
53
  </header>
52
54
  <div class="b-post__body">
53
55
  <slot />
@@ -64,7 +64,7 @@ const { tags, active } = Astro.props;
64
64
  .posts-filter__chip.is-active {
65
65
  background: var(--gold);
66
66
  border-color: var(--gold);
67
- color: var(--text-light);
67
+ color: var(--on-brand);
68
68
  }
69
69
  .posts-filter__count {
70
70
  font-size: 0.75em;
@@ -85,6 +85,7 @@ const year = new Date().getFullYear();
85
85
  {footerLinks.map((link) => (
86
86
  <a href={link.href} set:html={link.label} />
87
87
  ))}
88
+ {import.meta.env.FERST_ROUTES_ACCESSIBILITY !== false && <a href="/accessibility/">Accessibility</a>}
88
89
  <button type="button" id="footer-cookie-preferences">Cookie preferences</button>
89
90
  </nav>
90
91
  <p class="footer-copy">&copy; {year} All rights reserved.</p>
@@ -303,8 +304,7 @@ const year = new Date().getFullYear();
303
304
  font-weight: 600;
304
305
  letter-spacing: 0.1em;
305
306
  text-transform: uppercase;
306
- color: var(--text-footer);
307
- opacity: 0.8;
307
+ color: var(--text-footer); /* full strength: at 80% it fell below AA (3.8:1) */
308
308
  }
309
309
  .site-footer .footer-group ul {
310
310
  list-style: none;
@@ -398,7 +398,7 @@ const primaryNavLongestMatch = Math.max(-1, ...primaryNavMatchLengths);
398
398
  white-space: nowrap;
399
399
  }
400
400
  .nav-cta:hover,
401
- .nav-cta.active { background: color-mix(in srgb, var(--gold) 85%, #000); color: var(--text-light); border: none; }
401
+ .nav-cta.active { background: color-mix(in srgb, var(--gold) 85%, #000); color: var(--on-brand); border: none; }
402
402
  [data-theme="dark"] .nav-cta { background: var(--gold); color: var(--dark-bg); border: none; }
403
403
  [data-theme="dark"] .nav-cta:hover,
404
404
  [data-theme="dark"] .nav-cta.active { background: color-mix(in srgb, var(--gold) 85%, #fff); color: var(--dark-bg); border: none; }
@@ -111,7 +111,7 @@ const paras = text.split(/\n\s*\n/).map((p) => p.trim()).filter(Boolean);
111
111
  gap: 0.5rem;
112
112
  padding: 0.6rem 1.05rem;
113
113
  background: var(--gold);
114
- color: var(--text-light);
114
+ color: var(--on-brand);
115
115
  border-radius: 999px;
116
116
  box-shadow: var(--shadow-md);
117
117
  cursor: pointer;
@@ -33,9 +33,10 @@ const key = `ferst-dismissed-${id}`;
33
33
  font-size: 0.9rem;
34
34
  text-align: center;
35
35
  }
36
- .b-announce[data-tone='accent'] { background: var(--gold); color: var(--text-light); }
36
+ .b-announce[data-tone='accent'] { background: var(--gold); color: var(--on-brand); }
37
37
  .b-announce[data-tone='neutral'] { background: var(--bg-section); color: var(--fg); }
38
- .b-announce__text { margin: 0; line-height: 1.4; }
38
+ /* Its text takes the band's colour (on-brand or ink), not the site's grey paragraph colour. */
39
+ .b-announce__text { margin: 0; line-height: 1.4; color: inherit; }
39
40
  .b-announce__link {
40
41
  color: inherit;
41
42
  font-weight: 700;
@@ -23,6 +23,8 @@ interface Props {
23
23
  items?: Item[];
24
24
  }
25
25
  const { title, intro, items = [] } = Astro.props;
26
+ // Headings stay in order: items sit one level under the block's title, or take its place.
27
+ const ItemHeading = title ? 'h3' : 'h2';
26
28
  // Alignment overrides (BlockLayout): the title + intro default to centred; the block's
27
29
  // own `align`, or `headingAlign` for the title alone, overrides it from the page data.
28
30
  const { align: blockAlign, headingAlign } = Astro.props as { align?: 'start' | 'center' | 'end'; headingAlign?: 'start' | 'center' | 'end' };
@@ -46,7 +48,7 @@ const headAlign = headingAlign ?? blockAlign ?? 'center';
46
48
  <span class="b-bento__icon"><Icon name={item.icon} size={24} /></span>
47
49
  )}
48
50
  {item.eyebrow && <span class="b-bento__eyebrow">{item.eyebrow}</span>}
49
- <h3 class="b-bento__title">{item.title}</h3>
51
+ <ItemHeading class="b-bento__title">{item.title}</ItemHeading>
50
52
  {item.text && <p class="b-bento__text">{item.text}</p>}
51
53
  </Tag>
52
54
  );
@@ -106,7 +108,7 @@ const headAlign = headingAlign ?? blockAlign ?? 'center';
106
108
  }
107
109
  .b-bento__item[data-variant='surface'] { background: var(--bg-surface); border: var(--card-border); box-shadow: var(--shadow-md); }
108
110
  .b-bento__item[data-variant='filled'] { background: var(--gold-light); }
109
- .b-bento__item[data-variant='gradient'] { background: linear-gradient(135deg, var(--gold), var(--accent-2, var(--gold))); color: var(--text-light); }
111
+ .b-bento__item[data-variant='gradient'] { background: linear-gradient(135deg, var(--gold), var(--accent-2, var(--gold))); color: var(--on-brand); }
110
112
  .b-bento__item[data-variant='image'] { color: #fff; justify-content: flex-end; min-height: 11rem; }
111
113
  .b-bento__item[data-variant='image']::before {
112
114
  content: '';
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import Heading from '../blocks/Heading.astro';
13
13
  import Button from '../Button.astro';
14
+ import { autocompleteFor } from '../../lib/autocomplete';
14
15
 
15
16
  interface Field {
16
17
  name: string;
@@ -63,7 +64,7 @@ const headAlign = headingAlign ?? blockAlign ?? 'center';
63
64
  {type === 'textarea' ? (
64
65
  <textarea id={id} name={field.name} rows="5" required={field.required} placeholder={field.placeholder}></textarea>
65
66
  ) : (
66
- <input id={id} type={type} name={field.name} required={field.required} placeholder={field.placeholder} />
67
+ <input id={id} type={type} name={field.name} required={field.required} placeholder={field.placeholder} autocomplete={autocompleteFor({ ...field, type })} />
67
68
  )}
68
69
  </div>
69
70
  );