sproutsite 0.5.24 → 0.5.26
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.
- package/README.md +13 -6
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/VERSION +1 -1
- package/package.json +1 -1
- package/src/lib/sproutsite/branding.ts +7 -45
- package/src/lib/sproutsite/colors.ts +24 -0
- package/src/lib/sproutsite/hero-background.ts +61 -0
- package/src/lib/sproutsite/public-assets.ts +33 -0
- package/src/lib/sproutsite/remark-links.ts +4 -3
- package/src/lib/sproutsite/site-colors.ts +47 -0
- package/src/lib/sproutsite/site-config.ts +211 -38
- package/src/lib/sproutsite/sitemap.ts +2 -2
- package/src/lib/sproutsite/types.ts +7 -9
- package/src/lib/sproutsite/urls.ts +3 -3
- package/src/lib/sproutsite/validation.ts +4 -1
- package/src/package/config.ts +24 -9
- package/src/package/content.ts +25 -1
- package/src/package/manifest.ts +1 -1
- package/src/package/page.astro +6 -3
- package/src/package/starter-assets/README.md +6 -3
- package/src/themes/default/colors.ts +190 -0
- package/src/themes/default/components/atoms/HeroBackground/HeroBackground.astro +52 -0
- package/src/themes/default/components/atoms/HeroBackground/HeroBackground.css +23 -0
- package/src/themes/default/components/layout/Columns/Columns.css +1 -1
- package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.astro +8 -5
- package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.css +1 -1
- package/src/themes/default/components/organisms/BlogIndex/BlogIndex.astro +16 -13
- package/src/themes/default/components/organisms/BlogPost/BlogPost.astro +1 -1
- package/src/themes/default/components/organisms/Footer/Footer.astro +1 -1
- package/src/themes/default/components/organisms/Footer/Footer.css +1 -1
- package/src/themes/default/components/organisms/Header/Header.astro +2 -2
- package/src/themes/default/components/organisms/Header/Header.css +10 -7
- package/src/themes/default/components/organisms/Hero/Hero.astro +12 -13
- package/src/themes/default/components/organisms/Hero/Hero.css +56 -30
- package/src/themes/default/components/organisms/PageTitle/PageTitle.astro +19 -0
- package/src/themes/default/layouts/ErrorPage/ErrorPage.astro +7 -6
- package/src/themes/default/layouts/PageLayout/PageLayout.astro +8 -3
- package/src/themes/default/styles/foundation/tokens.css +1 -0
- package/src/themes/default/styles/theme.css +1 -0
- package/src/themes/default/styles/themes/section-tones.css +7 -3
- package/src/themes/default/assets/hero-waves.svg +0 -41
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type { SiteColors } from '../../lib/sproutsite/site-colors.js';
|
|
2
|
+
import { contrastRatio } from '../../lib/sproutsite/colors.js';
|
|
3
|
+
|
|
4
|
+
// CSS supplies the no-config defaults. The palette contract test keeps this
|
|
5
|
+
// contrast reference aligned with theme.css and foundation/tokens.css.
|
|
6
|
+
export const defaultColors = {
|
|
7
|
+
surfaces: {
|
|
8
|
+
default: '#ffffff',
|
|
9
|
+
muted: '#f5f7fa',
|
|
10
|
+
border: '#e2e8f0',
|
|
11
|
+
text: '#0b1f3a',
|
|
12
|
+
},
|
|
13
|
+
primary: { color: '#134b70', content: '#ffffff' },
|
|
14
|
+
secondary: { color: '#0f766e', content: '#ffffff' },
|
|
15
|
+
accent: { color: '#b45309', content: '#ffffff' },
|
|
16
|
+
neutral: { color: '#26334a', content: '#ffffff' },
|
|
17
|
+
info: { color: '#1769aa', content: '#ffffff' },
|
|
18
|
+
success: { color: '#19764b', content: '#ffffff' },
|
|
19
|
+
warning: { color: '#9a5b00', content: '#ffffff' },
|
|
20
|
+
error: { color: '#b42318', content: '#ffffff' },
|
|
21
|
+
brand: {
|
|
22
|
+
background: '#071a36',
|
|
23
|
+
backgroundEnd: '#0d2b50',
|
|
24
|
+
gradient: '#125b86',
|
|
25
|
+
content: '#ffffff',
|
|
26
|
+
highlight: '#70c6df',
|
|
27
|
+
accent: '#74e33d',
|
|
28
|
+
},
|
|
29
|
+
} satisfies SiteColors;
|
|
30
|
+
|
|
31
|
+
export const colorVariables = {
|
|
32
|
+
surfaces: {
|
|
33
|
+
default: '--color-base-100',
|
|
34
|
+
muted: '--color-base-200',
|
|
35
|
+
border: '--color-base-300',
|
|
36
|
+
text: '--color-base-content',
|
|
37
|
+
},
|
|
38
|
+
primary: { color: '--color-primary', content: '--color-primary-content' },
|
|
39
|
+
secondary: {
|
|
40
|
+
color: '--color-secondary',
|
|
41
|
+
content: '--color-secondary-content',
|
|
42
|
+
},
|
|
43
|
+
accent: { color: '--color-accent', content: '--color-accent-content' },
|
|
44
|
+
neutral: { color: '--color-neutral', content: '--color-neutral-content' },
|
|
45
|
+
info: { color: '--color-info', content: '--color-info-content' },
|
|
46
|
+
success: { color: '--color-success', content: '--color-success-content' },
|
|
47
|
+
warning: { color: '--color-warning', content: '--color-warning-content' },
|
|
48
|
+
error: { color: '--color-error', content: '--color-error-content' },
|
|
49
|
+
brand: {
|
|
50
|
+
background: '--color-hero-navy',
|
|
51
|
+
backgroundEnd: '--color-hero-midnight',
|
|
52
|
+
gradient: '--color-hero-ocean',
|
|
53
|
+
content: '--color-brand-content',
|
|
54
|
+
highlight: '--color-hero-cyan',
|
|
55
|
+
accent: '--color-hero-green',
|
|
56
|
+
},
|
|
57
|
+
} satisfies {
|
|
58
|
+
[G in keyof Required<SiteColors>]: {
|
|
59
|
+
[K in keyof Required<Required<SiteColors>[G]>]: `--${string}`;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
type Palette = {
|
|
64
|
+
[G in keyof typeof defaultColors]: Record<
|
|
65
|
+
keyof (typeof defaultColors)[G],
|
|
66
|
+
string
|
|
67
|
+
>;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export function resolveColors(input?: SiteColors): Palette {
|
|
71
|
+
return {
|
|
72
|
+
surfaces: { ...defaultColors.surfaces, ...input?.surfaces },
|
|
73
|
+
primary: { ...defaultColors.primary, ...input?.primary },
|
|
74
|
+
secondary: { ...defaultColors.secondary, ...input?.secondary },
|
|
75
|
+
accent: { ...defaultColors.accent, ...input?.accent },
|
|
76
|
+
neutral: { ...defaultColors.neutral, ...input?.neutral },
|
|
77
|
+
info: { ...defaultColors.info, ...input?.info },
|
|
78
|
+
success: { ...defaultColors.success, ...input?.success },
|
|
79
|
+
warning: { ...defaultColors.warning, ...input?.warning },
|
|
80
|
+
error: { ...defaultColors.error, ...input?.error },
|
|
81
|
+
brand: { ...defaultColors.brand, ...input?.brand },
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Checks known solid text/surface pairs, not image overlays or all component states. */
|
|
86
|
+
export function colorContrastIssues(input?: SiteColors): string[] {
|
|
87
|
+
if (!input) return [];
|
|
88
|
+
const palette = resolveColors(input);
|
|
89
|
+
const issues: string[] = [];
|
|
90
|
+
const check = (
|
|
91
|
+
foreground: string,
|
|
92
|
+
background: string,
|
|
93
|
+
field: string,
|
|
94
|
+
against: string,
|
|
95
|
+
minimum = 4.5,
|
|
96
|
+
) => {
|
|
97
|
+
const ratio = contrastRatio(foreground, background);
|
|
98
|
+
if (ratio < minimum)
|
|
99
|
+
issues.push(
|
|
100
|
+
`${field} against ${against}: ${ratio.toFixed(2)}:1; expected at least ${minimum}:1. Choose a darker/lighter colour or adjust the matching content colour.`,
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
for (const role of [
|
|
104
|
+
'primary',
|
|
105
|
+
'secondary',
|
|
106
|
+
'accent',
|
|
107
|
+
'neutral',
|
|
108
|
+
'info',
|
|
109
|
+
'success',
|
|
110
|
+
'warning',
|
|
111
|
+
'error',
|
|
112
|
+
] as const) {
|
|
113
|
+
if (input[role])
|
|
114
|
+
check(
|
|
115
|
+
palette[role].content,
|
|
116
|
+
palette[role].color,
|
|
117
|
+
`colors.${role}.content`,
|
|
118
|
+
`colors.${role}.color`,
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
if (input.surfaces) {
|
|
122
|
+
for (const surface of ['default', 'muted'] as const)
|
|
123
|
+
check(
|
|
124
|
+
palette.surfaces.text,
|
|
125
|
+
palette.surfaces[surface],
|
|
126
|
+
'colors.surfaces.text',
|
|
127
|
+
`colors.surfaces.${surface}`,
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
// Primary is also used for running-text links and eyebrows.
|
|
131
|
+
if (input.primary || input.surfaces) {
|
|
132
|
+
for (const surface of ['default', 'muted'] as const)
|
|
133
|
+
check(
|
|
134
|
+
palette.primary.color,
|
|
135
|
+
palette.surfaces[surface],
|
|
136
|
+
'colors.primary.color',
|
|
137
|
+
`colors.surfaces.${surface}`,
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
if (input.brand) {
|
|
141
|
+
for (const background of [
|
|
142
|
+
'background',
|
|
143
|
+
'backgroundEnd',
|
|
144
|
+
'gradient',
|
|
145
|
+
] as const) {
|
|
146
|
+
check(
|
|
147
|
+
palette.brand.content,
|
|
148
|
+
palette.brand[background],
|
|
149
|
+
'colors.brand.content',
|
|
150
|
+
`colors.brand.${background}`,
|
|
151
|
+
);
|
|
152
|
+
if (background !== 'gradient')
|
|
153
|
+
check(
|
|
154
|
+
palette.brand.highlight,
|
|
155
|
+
palette.brand[background],
|
|
156
|
+
'colors.brand.highlight',
|
|
157
|
+
`colors.brand.${background}`,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
check(
|
|
161
|
+
palette.brand.accent,
|
|
162
|
+
palette.brand.background,
|
|
163
|
+
'colors.brand.accent',
|
|
164
|
+
'colors.brand.background',
|
|
165
|
+
3,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
return issues;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** Validated values only; no arbitrary CSS names or expressions enter markup. */
|
|
172
|
+
export function colorStyles(
|
|
173
|
+
input?: SiteColors,
|
|
174
|
+
source = 'site configuration',
|
|
175
|
+
): Record<string, string> {
|
|
176
|
+
const issues = colorContrastIssues(input);
|
|
177
|
+
if (issues.length)
|
|
178
|
+
throw new Error(`Invalid ${source}: ${issues.join('; ')}`);
|
|
179
|
+
const styles: Record<string, string> = {};
|
|
180
|
+
for (const group of Object.keys(colorVariables) as (keyof SiteColors)[]) {
|
|
181
|
+
const values = input?.[group];
|
|
182
|
+
if (!values) continue;
|
|
183
|
+
const variables: Record<string, string> = colorVariables[group];
|
|
184
|
+
for (const [key, value] of Object.entries(values))
|
|
185
|
+
if (value !== undefined) styles[variables[key]!] = value;
|
|
186
|
+
}
|
|
187
|
+
if (input?.brand?.background)
|
|
188
|
+
styles['--ss-hero-image-overlay'] = input.brand.background;
|
|
189
|
+
return styles;
|
|
190
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ImageMetadata } from 'astro';
|
|
3
|
+
import { Image } from 'astro:assets';
|
|
4
|
+
import { publicImageMetadata } from '../../../../../lib/sproutsite/public-assets.js';
|
|
5
|
+
import {
|
|
6
|
+
validateHeroBackground,
|
|
7
|
+
validateHeroBackgroundImage,
|
|
8
|
+
} from '../../../../../lib/sproutsite/hero-background.js';
|
|
9
|
+
import { withBase } from '../../../../../lib/sproutsite/urls.js';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
source: ImageMetadata | string;
|
|
13
|
+
base: string;
|
|
14
|
+
}
|
|
15
|
+
const { source, base } = Astro.props;
|
|
16
|
+
if (typeof source === 'string')
|
|
17
|
+
validateHeroBackground(source, 'hero background');
|
|
18
|
+
if (typeof source === 'string') await validateHeroBackgroundImage(source);
|
|
19
|
+
const image =
|
|
20
|
+
typeof source === 'string'
|
|
21
|
+
? {
|
|
22
|
+
...(await publicImageMetadata(source)),
|
|
23
|
+
src: withBase(source, base),
|
|
24
|
+
}
|
|
25
|
+
: source;
|
|
26
|
+
const svg = image.format === 'svg';
|
|
27
|
+
const classes = ['ss-hero-background', { 'ss-hero-background--svg': svg }];
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
{typeof source === 'string' || svg ? (
|
|
31
|
+
<img
|
|
32
|
+
class:list={classes}
|
|
33
|
+
src={image.src}
|
|
34
|
+
width={image.width}
|
|
35
|
+
height={image.height}
|
|
36
|
+
alt=""
|
|
37
|
+
loading="eager"
|
|
38
|
+
decoding="async"
|
|
39
|
+
aria-hidden="true"
|
|
40
|
+
/>
|
|
41
|
+
) : (
|
|
42
|
+
<Image
|
|
43
|
+
class:list={classes}
|
|
44
|
+
src={source}
|
|
45
|
+
alt=""
|
|
46
|
+
format="webp"
|
|
47
|
+
quality={82}
|
|
48
|
+
loading="eager"
|
|
49
|
+
decoding="async"
|
|
50
|
+
aria-hidden="true"
|
|
51
|
+
/>
|
|
52
|
+
)}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ss-hero-background {
|
|
3
|
+
pointer-events: none;
|
|
4
|
+
position: absolute;
|
|
5
|
+
inset: 0;
|
|
6
|
+
z-index: 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
object-fit: cover;
|
|
10
|
+
object-position: center;
|
|
11
|
+
|
|
12
|
+
&.ss-hero-background--svg {
|
|
13
|
+
object-position: right top;
|
|
14
|
+
|
|
15
|
+
@media (width < 64rem) {
|
|
16
|
+
left: auto;
|
|
17
|
+
width: auto;
|
|
18
|
+
max-width: none;
|
|
19
|
+
opacity: 0.5;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
&.ss-columns--divider,
|
|
6
6
|
&.ss-columns--separator,
|
|
7
7
|
&.ss-columns--spaced {
|
|
8
|
-
--ss-columns-divider-color:
|
|
8
|
+
--ss-columns-divider-color: var(--color-base-300);
|
|
9
9
|
--ss-columns-divider-gap: 6rem;
|
|
10
10
|
--ss-columns-divider-gap-mobile: calc(
|
|
11
11
|
var(--ss-columns-divider-gap) / 2
|
|
@@ -24,8 +24,8 @@ const flags: Record<string, string> = { en: englishFlag, de: germanFlag };
|
|
|
24
24
|
const options = languageLinks(
|
|
25
25
|
pages,
|
|
26
26
|
posts,
|
|
27
|
-
site.locales,
|
|
28
|
-
site.
|
|
27
|
+
site.i18n.locales,
|
|
28
|
+
site.i18n.locale,
|
|
29
29
|
route,
|
|
30
30
|
).map((option) => ({
|
|
31
31
|
...option,
|
|
@@ -35,7 +35,7 @@ const options = languageLinks(
|
|
|
35
35
|
) ?? option.locale,
|
|
36
36
|
flag: flags[option.locale],
|
|
37
37
|
href:
|
|
38
|
-
site.locales.length > 1
|
|
38
|
+
site.i18n.locales.length > 1
|
|
39
39
|
? getRelativeLocaleUrl(option.locale, option.route.slice(1))
|
|
40
40
|
: withBase(option.route, site.base),
|
|
41
41
|
}));
|
|
@@ -48,14 +48,17 @@ const options = languageLinks(
|
|
|
48
48
|
]}
|
|
49
49
|
>
|
|
50
50
|
<summary
|
|
51
|
-
aria-label={t(
|
|
51
|
+
aria-label={t(
|
|
52
|
+
site.i18n.locale === 'de' ? 'de' : 'en',
|
|
53
|
+
'languageSwitcher',
|
|
54
|
+
)}
|
|
52
55
|
>
|
|
53
56
|
<Icon
|
|
54
57
|
name="Globe"
|
|
55
58
|
size={20}
|
|
56
59
|
strokeWidth={placement === 'footer' ? 1.5 : 2}
|
|
57
60
|
/>
|
|
58
|
-
<span>{site.
|
|
61
|
+
<span>{site.i18n.locale.toUpperCase()}</span>
|
|
59
62
|
<Icon name="ChevronDown" size={16} />
|
|
60
63
|
</summary>
|
|
61
64
|
<ul class="ss-language-switcher__options">
|
|
@@ -17,14 +17,16 @@ interface Props {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const { posts, site } = Astro.props;
|
|
20
|
-
const locale = site.
|
|
20
|
+
const locale = site.i18n.locale === 'de' ? 'de' : 'en';
|
|
21
21
|
const blog = site.blog ?? {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
hero: {
|
|
23
|
+
title: 'Blog',
|
|
24
|
+
description: t(locale, 'blogDescription'),
|
|
25
|
+
eyebrow: t(locale, 'blogEyebrow'),
|
|
26
|
+
},
|
|
27
|
+
articles: { heading: t(locale, 'blogHeading') },
|
|
26
28
|
};
|
|
27
|
-
const dateFormatter = new Intl.DateTimeFormat(site.
|
|
29
|
+
const dateFormatter = new Intl.DateTimeFormat(site.i18n.locale, {
|
|
28
30
|
day: '2-digit',
|
|
29
31
|
month: 'long',
|
|
30
32
|
year: 'numeric',
|
|
@@ -34,15 +36,16 @@ const dateFormatter = new Intl.DateTimeFormat(site.language, {
|
|
|
34
36
|
|
|
35
37
|
<PageLayout
|
|
36
38
|
site={site}
|
|
37
|
-
title={blog.title}
|
|
38
|
-
description={blog.description}
|
|
39
|
+
title={blog.hero.title}
|
|
40
|
+
description={blog.hero.description}
|
|
39
41
|
route="/blog/"
|
|
40
42
|
>
|
|
41
43
|
<PageTitle
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
site={site}
|
|
45
|
+
title={blog.hero.title}
|
|
46
|
+
eyebrow={blog.hero.eyebrow}
|
|
47
|
+
description={blog.hero.description}
|
|
48
|
+
classes={site.hero.classes}
|
|
46
49
|
variant="hero"
|
|
47
50
|
/>
|
|
48
51
|
<section
|
|
@@ -51,7 +54,7 @@ const dateFormatter = new Intl.DateTimeFormat(site.language, {
|
|
|
51
54
|
>
|
|
52
55
|
<div class="ss-section__inner site-shell">
|
|
53
56
|
<div class="content-prose ss-blog-index__content">
|
|
54
|
-
<h2 id="blog-overview">{blog.heading}</h2>
|
|
57
|
+
<h2 id="blog-overview">{blog.articles.heading}</h2>
|
|
55
58
|
<div class="ss-blog-index__grid">
|
|
56
59
|
{posts.map((post) => (
|
|
57
60
|
<Card
|
|
@@ -20,7 +20,7 @@ interface Props {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const { post, site, HeroContent, sections } = Astro.props;
|
|
23
|
-
const dateFormatter = new Intl.DateTimeFormat(site.
|
|
23
|
+
const dateFormatter = new Intl.DateTimeFormat(site.i18n.locale, {
|
|
24
24
|
day: '2-digit',
|
|
25
25
|
month: 'long',
|
|
26
26
|
year: 'numeric',
|
|
@@ -16,7 +16,7 @@ interface Props {
|
|
|
16
16
|
route: string;
|
|
17
17
|
}
|
|
18
18
|
const { site, route } = Astro.props;
|
|
19
|
-
const language = site.
|
|
19
|
+
const language = site.i18n.locale === 'de' ? 'de' : 'en';
|
|
20
20
|
const socialIcons = {
|
|
21
21
|
github: siGithub,
|
|
22
22
|
instagram: siInstagram,
|
|
@@ -17,7 +17,7 @@ interface Props {
|
|
|
17
17
|
route: string;
|
|
18
18
|
}
|
|
19
19
|
const { site, route } = Astro.props;
|
|
20
|
-
const language = site.
|
|
20
|
+
const language = site.i18n.locale === 'de' ? 'de' : 'en';
|
|
21
21
|
const hasLanguageSwitcher = site.header.links.some(
|
|
22
22
|
(link) => link.type === 'language-switcher',
|
|
23
23
|
);
|
|
@@ -51,7 +51,7 @@ const hasLanguageSwitcher = site.header.links.some(
|
|
|
51
51
|
<nav
|
|
52
52
|
class="ss-header__nav"
|
|
53
53
|
aria-label={t(
|
|
54
|
-
site.
|
|
54
|
+
site.i18n.locale === 'de' ? 'de' : 'en',
|
|
55
55
|
'primaryNavigation',
|
|
56
56
|
)}
|
|
57
57
|
>
|
|
@@ -3,20 +3,22 @@
|
|
|
3
3
|
--ss-logo-light-visibility: hidden;
|
|
4
4
|
--ss-logo-dark-visibility: visible;
|
|
5
5
|
--ss-header-active-underline: var(--color-hero-cyan);
|
|
6
|
-
--ss-header-cta-outline: var(--color-
|
|
6
|
+
--ss-header-cta-outline: var(--color-brand-content);
|
|
7
7
|
--ss-header-dropdown-bg: var(--color-hero-navy);
|
|
8
8
|
--ss-header-dropdown-border: color-mix(
|
|
9
9
|
in srgb,
|
|
10
10
|
currentColor 35%,
|
|
11
11
|
transparent
|
|
12
12
|
);
|
|
13
|
-
|
|
13
|
+
color: var(--color-brand-content);
|
|
14
|
+
@apply absolute inset-x-0 top-0 z-40 border-b border-transparent bg-transparent transition-[background-color,border-color,box-shadow,backdrop-filter] duration-200;
|
|
14
15
|
|
|
15
16
|
.ss-header__inner {
|
|
16
17
|
@apply flex flex-wrap items-center justify-between gap-x-8 gap-y-3 py-[2.1875rem] transition-[padding] duration-200;
|
|
17
18
|
|
|
18
19
|
.ss-header__brand {
|
|
19
|
-
@apply inline-flex items-center gap-3 text-lg font-bold
|
|
20
|
+
@apply inline-flex items-center gap-3 text-lg font-bold no-underline hover:underline;
|
|
21
|
+
color: inherit;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
.ss-header__link,
|
|
@@ -47,7 +49,8 @@
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
.ss-header__link {
|
|
50
|
-
@apply relative !gap-2.5 !text-lg
|
|
52
|
+
@apply relative !gap-2.5 !text-lg no-underline;
|
|
53
|
+
color: var(--color-brand-content) !important;
|
|
51
54
|
border-color: transparent !important;
|
|
52
55
|
box-shadow: none !important;
|
|
53
56
|
|
|
@@ -100,7 +103,7 @@
|
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
.ss-header__brand {
|
|
103
|
-
color: var(--color-
|
|
106
|
+
color: var(--color-base-content) !important;
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
}
|
|
@@ -133,7 +136,7 @@
|
|
|
133
136
|
--ss-logo-dark-visibility: visible;
|
|
134
137
|
--ss-brand-highlight: var(--color-hero-cyan);
|
|
135
138
|
--ss-header-active-underline: var(--color-hero-cyan);
|
|
136
|
-
--ss-header-cta-outline: var(--color-
|
|
139
|
+
--ss-header-cta-outline: var(--color-brand-content);
|
|
137
140
|
--ss-header-dropdown-bg: var(--color-hero-navy);
|
|
138
141
|
--ss-header-dropdown-border: color-mix(
|
|
139
142
|
in srgb,
|
|
@@ -149,7 +152,7 @@
|
|
|
149
152
|
margin: 0;
|
|
150
153
|
padding: 0;
|
|
151
154
|
border: 0;
|
|
152
|
-
color: var(--color-
|
|
155
|
+
color: var(--color-brand-content);
|
|
153
156
|
background: linear-gradient(
|
|
154
157
|
145deg,
|
|
155
158
|
var(--color-hero-midnight),
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { CollectionEntry } from 'astro:content';
|
|
3
|
-
import
|
|
3
|
+
import HeroBackground from '../../atoms/HeroBackground/HeroBackground.astro';
|
|
4
|
+
import {
|
|
5
|
+
selectHeroBackground,
|
|
6
|
+
isSvgHeroImage,
|
|
7
|
+
} from '../../../../../lib/sproutsite/hero-background.js';
|
|
4
8
|
import { toneOf } from '../../../../../lib/sproutsite/pages.js';
|
|
5
9
|
import type { SiteConfig } from '../../../../../lib/sproutsite/types.js';
|
|
6
10
|
import Button from '../../atoms/Button/Button.astro';
|
|
@@ -21,9 +25,12 @@ const toneClass = {
|
|
|
21
25
|
}[toneOf(hero)];
|
|
22
26
|
const heroClasses =
|
|
23
27
|
hero.data.classes === undefined
|
|
24
|
-
? site.
|
|
28
|
+
? site.hero.classes
|
|
25
29
|
: (hero.data.classes ?? []);
|
|
26
|
-
const backgroundImage =
|
|
30
|
+
const backgroundImage = selectHeroBackground(
|
|
31
|
+
hero.data['background-image'],
|
|
32
|
+
site.hero['background-image'],
|
|
33
|
+
);
|
|
27
34
|
const heroTitle = hero.data.title;
|
|
28
35
|
if (!heroTitle) throw new Error('Sproutsite Hero requires a title.');
|
|
29
36
|
const titleHighlight = hero.data.titleHighlight;
|
|
@@ -47,21 +54,13 @@ const titleLines = heroTitle.split('\n').map((line) => {
|
|
|
47
54
|
'ss-hero',
|
|
48
55
|
`ss-hero--${hero.data.type ?? 'small'}`,
|
|
49
56
|
{ 'ss-hero--has-background-image': Boolean(backgroundImage) },
|
|
57
|
+
{ 'ss-hero--background-svg': isSvgHeroImage(backgroundImage) },
|
|
50
58
|
...heroClasses,
|
|
51
59
|
]}
|
|
52
60
|
aria-labelledby="page-title"
|
|
53
61
|
>
|
|
54
62
|
{backgroundImage && (
|
|
55
|
-
<
|
|
56
|
-
class="ss-hero__background"
|
|
57
|
-
src={backgroundImage}
|
|
58
|
-
alt=""
|
|
59
|
-
format="webp"
|
|
60
|
-
quality={82}
|
|
61
|
-
loading="eager"
|
|
62
|
-
decoding="async"
|
|
63
|
-
aria-hidden="true"
|
|
64
|
-
/>
|
|
63
|
+
<HeroBackground source={backgroundImage} base={site.base} />
|
|
65
64
|
)}
|
|
66
65
|
<div class="ss-hero__inner site-shell">
|
|
67
66
|
{hero.data.eyebrow && <Eyebrow>{hero.data.eyebrow}</Eyebrow>}
|