sproutsite 0.5.25 → 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 +2 -0
- package/VERSION +1 -1
- package/package.json +1 -1
- package/src/lib/sproutsite/colors.ts +24 -0
- package/src/lib/sproutsite/site-colors.ts +47 -0
- package/src/lib/sproutsite/site-config.ts +2 -0
- package/src/lib/sproutsite/types.ts +2 -0
- package/src/package/config.ts +7 -0
- package/src/themes/default/colors.ts +190 -0
- package/src/themes/default/components/layout/Columns/Columns.css +1 -1
- package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.css +1 -1
- package/src/themes/default/components/organisms/Footer/Footer.css +1 -1
- package/src/themes/default/components/organisms/Header/Header.css +10 -7
- package/src/themes/default/components/organisms/Hero/Hero.css +49 -12
- package/src/themes/default/layouts/PageLayout/PageLayout.astro +6 -1
- package/src/themes/default/styles/foundation/tokens.css +1 -0
- package/src/themes/default/styles/themes/section-tones.css +7 -3
package/README.md
CHANGED
|
@@ -299,6 +299,8 @@ tagline: A short supporting claim.
|
|
|
299
299
|
---
|
|
300
300
|
```
|
|
301
301
|
|
|
302
|
+
The default theme accepts an optional `colors` block: `surfaces` (`default`, `muted`, `border`, `text`), semantic roles (`primary`, `secondary`, `accent`, `neutral`, `info`, `success`, `warning`, `error`, each with `color`/`content`), and `brand` (`background`, `backgroundEnd`, `gradient`, `content`, `highlight`, `accent`). Values are opaque hex colours (`#RGB` or `#RRGGBB`); omitted fields retain the theme defaults. For example, `colors: { primary: { color: "#527b37", content: "#ffffff" } }` changes the primary role. Standard solid text/background pairs are checked for contrast against the resolved defaults; invalid fields or insufficient checked contrast stop Astro configuration/rendering. These checks do not establish conformance for image overlays or every component state. SVG waves, logos and images keep their embedded colours and must be edited separately. See the [website colour guide](https://sproutsite.dev/documentation/getting-started/your-website/colors/).
|
|
303
|
+
|
|
302
304
|
`site.yaml` is the shared base. Optional `site.<locale>.yaml` files override individual object fields; arrays replace the entire inherited list. Omitted fields inherit the base values. Production URL, base path, default locale and enabled locale list remain shared. The base `i18n.locale` matches `i18n.defaultLocale`; locale files may set their own `i18n.locale`. The default locale is explicit and does not depend on list order. Legacy `language`/`locales`, `links.externalNewTab`/`externalIcon` and flat blog settings remain readable, but do not mix old and new spellings within a configuration layer.
|
|
303
305
|
|
|
304
306
|
English and German content can be maintained in the same project. Configure `i18n: { locale: en, defaultLocale: en, locales: [en, de] }` in `site.yaml`, add `site.de.yaml` with `i18n.locale: de` and German navigation, and add translated `page.de.yaml`, `hero.de.md`, and numbered `.de.md`/`.de.mdx` sections. Add `src/pages/de/[...slug].astro` using the same page component and an async `getStaticPaths()` wrapper that calls `getSproutsiteStaticPaths('de')`. Each locale uses its own copy and optional URL segments; translations are not generated automatically. Keep section numbers aligned between languages.
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.26
|
package/package.json
CHANGED
|
@@ -5,3 +5,27 @@ export function isHexColor(value: unknown): value is `#${string}` {
|
|
|
5
5
|
/^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i.test(value)
|
|
6
6
|
);
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
/** Relative luminance for opaque, validated sRGB hex colours (WCAG). */
|
|
10
|
+
function luminance(hex: string): number {
|
|
11
|
+
const value =
|
|
12
|
+
hex.length === 4
|
|
13
|
+
? [...hex.slice(1)].map((digit) => digit + digit).join('')
|
|
14
|
+
: hex.slice(1);
|
|
15
|
+
const channels = [0, 2, 4].map((offset) => {
|
|
16
|
+
const channel =
|
|
17
|
+
Number.parseInt(value.slice(offset, offset + 2), 16) / 255;
|
|
18
|
+
return channel <= 0.04045
|
|
19
|
+
? channel / 12.92
|
|
20
|
+
: ((channel + 0.055) / 1.055) ** 2.4;
|
|
21
|
+
});
|
|
22
|
+
return (
|
|
23
|
+
channels[0]! * 0.2126 + channels[1]! * 0.7152 + channels[2]! * 0.0722
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function contrastRatio(first: string, second: string): number {
|
|
28
|
+
const a = luminance(first);
|
|
29
|
+
const b = luminance(second);
|
|
30
|
+
return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
|
|
31
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Opaque colours keep palette contrast predictable; components retain their own API. */
|
|
4
|
+
const hex = z
|
|
5
|
+
.string()
|
|
6
|
+
.regex(
|
|
7
|
+
/^#(?:[\da-f]{3}|[\da-f]{6})$/i,
|
|
8
|
+
'must be an opaque hex colour (#RGB or #RRGGBB)',
|
|
9
|
+
);
|
|
10
|
+
const pair = z
|
|
11
|
+
.object({ color: hex.optional(), content: hex.optional() })
|
|
12
|
+
.strict();
|
|
13
|
+
|
|
14
|
+
export const siteColorsSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
surfaces: z
|
|
17
|
+
.object({
|
|
18
|
+
default: hex.optional(),
|
|
19
|
+
muted: hex.optional(),
|
|
20
|
+
border: hex.optional(),
|
|
21
|
+
text: hex.optional(),
|
|
22
|
+
})
|
|
23
|
+
.strict()
|
|
24
|
+
.optional(),
|
|
25
|
+
primary: pair.optional(),
|
|
26
|
+
secondary: pair.optional(),
|
|
27
|
+
accent: pair.optional(),
|
|
28
|
+
neutral: pair.optional(),
|
|
29
|
+
info: pair.optional(),
|
|
30
|
+
success: pair.optional(),
|
|
31
|
+
warning: pair.optional(),
|
|
32
|
+
error: pair.optional(),
|
|
33
|
+
brand: z
|
|
34
|
+
.object({
|
|
35
|
+
background: hex.optional(),
|
|
36
|
+
backgroundEnd: hex.optional(),
|
|
37
|
+
gradient: hex.optional(),
|
|
38
|
+
content: hex.optional(),
|
|
39
|
+
highlight: hex.optional(),
|
|
40
|
+
accent: hex.optional(),
|
|
41
|
+
})
|
|
42
|
+
.strict()
|
|
43
|
+
.optional(),
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
|
|
47
|
+
export type SiteColors = z.infer<typeof siteColorsSchema>;
|
|
@@ -5,6 +5,7 @@ import { parse } from 'yaml';
|
|
|
5
5
|
import type { SiteConfig } from './types.js';
|
|
6
6
|
import { publicHeroImage, validateHeroBackground } from './hero-background.js';
|
|
7
7
|
import { brandingSchema, validateBrandingFiles } from './branding.js';
|
|
8
|
+
import { siteColorsSchema } from './site-colors.js';
|
|
8
9
|
|
|
9
10
|
const linkSchema = z.object({
|
|
10
11
|
label: z.string().trim().min(1),
|
|
@@ -60,6 +61,7 @@ const fontSelectionSchema = z
|
|
|
60
61
|
|
|
61
62
|
const siteSchema = z.object({
|
|
62
63
|
branding: brandingSchema.optional(),
|
|
64
|
+
colors: siteColorsSchema.optional(),
|
|
63
65
|
typography: z
|
|
64
66
|
.object({
|
|
65
67
|
headings: fontSelectionSchema,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Branding } from './branding.js';
|
|
2
|
+
import type { SiteColors } from './site-colors.js';
|
|
2
3
|
|
|
3
4
|
export const tones = ['default', 'muted', 'brand'] as const;
|
|
4
5
|
export type Tone = (typeof tones)[number];
|
|
@@ -31,6 +32,7 @@ export type HeaderItem =
|
|
|
31
32
|
|
|
32
33
|
export interface SiteConfig {
|
|
33
34
|
branding?: Branding;
|
|
35
|
+
colors?: SiteColors;
|
|
34
36
|
name: string;
|
|
35
37
|
url: string;
|
|
36
38
|
base: string;
|
package/src/package/config.ts
CHANGED
|
@@ -19,11 +19,18 @@ import { validateSproutsiteContent } from '../lib/sproutsite/validation.js';
|
|
|
19
19
|
import { createSitemapMetadata } from '../lib/sproutsite/sitemap.js';
|
|
20
20
|
import { validateBrandingImages } from '../lib/sproutsite/branding.js';
|
|
21
21
|
import { validateHeroBackgroundImage } from '../lib/sproutsite/hero-background.js';
|
|
22
|
+
import { colorStyles } from '../themes/default/colors.js';
|
|
22
23
|
|
|
23
24
|
/** Returns the Astro configuration required by the default Sproutsite theme. */
|
|
24
25
|
export function createSproutsiteConfig() {
|
|
25
26
|
validateSproutsiteContent();
|
|
26
27
|
const site = loadSiteConfig();
|
|
28
|
+
for (const locale of site.i18n.locales) {
|
|
29
|
+
colorStyles(
|
|
30
|
+
loadSiteConfig(locale).colors,
|
|
31
|
+
`src/content/site.yaml / site.${locale}.yaml`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
27
34
|
let sitemapMetadata: ReturnType<typeof createSitemapMetadata> | undefined;
|
|
28
35
|
|
|
29
36
|
return {
|
|
@@ -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
|
+
}
|
|
@@ -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
|
|
@@ -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),
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
.ss-hero__claim {
|
|
45
45
|
margin-top: clamp(1rem, 1.5vw, 1.25rem);
|
|
46
46
|
max-width: 42rem;
|
|
47
|
-
color: var(--color-primary-content);
|
|
47
|
+
color: var(--ss-hero-content, var(--color-primary-content));
|
|
48
48
|
font-family: var(--font-heading);
|
|
49
49
|
font-size: clamp(1.75rem, 2.5vw, 2.25rem);
|
|
50
50
|
font-weight: var(--ss-heading-weight, 500);
|
|
@@ -73,16 +73,23 @@
|
|
|
73
73
|
.btn-outline {
|
|
74
74
|
--btn-color: color-mix(
|
|
75
75
|
in srgb,
|
|
76
|
-
var(--color-primary-content) 56%,
|
|
76
|
+
var(--ss-hero-content, var(--color-primary-content)) 56%,
|
|
77
77
|
transparent
|
|
78
78
|
);
|
|
79
|
-
--btn-rest-fg: var(
|
|
79
|
+
--btn-rest-fg: var(
|
|
80
|
+
--ss-hero-content,
|
|
81
|
+
var(--color-primary-content)
|
|
82
|
+
);
|
|
80
83
|
|
|
81
84
|
&:hover {
|
|
82
|
-
--btn-color: var(
|
|
85
|
+
--btn-color: var(
|
|
86
|
+
--ss-hero-content,
|
|
87
|
+
var(--color-primary-content)
|
|
88
|
+
);
|
|
83
89
|
--btn-bg: color-mix(
|
|
84
90
|
in srgb,
|
|
85
|
-
var(--color-primary-content)
|
|
91
|
+
var(--ss-hero-content, var(--color-primary-content))
|
|
92
|
+
12%,
|
|
86
93
|
transparent
|
|
87
94
|
);
|
|
88
95
|
}
|
|
@@ -93,7 +100,7 @@
|
|
|
93
100
|
margin-top: 1.5rem;
|
|
94
101
|
color: color-mix(
|
|
95
102
|
in srgb,
|
|
96
|
-
var(--color-primary-content) 72%,
|
|
103
|
+
var(--ss-hero-content, var(--color-primary-content)) 72%,
|
|
97
104
|
transparent
|
|
98
105
|
);
|
|
99
106
|
font-size: 0.9375rem;
|
|
@@ -102,7 +109,10 @@
|
|
|
102
109
|
}
|
|
103
110
|
|
|
104
111
|
&.ss-hero--has-background-image {
|
|
105
|
-
|
|
112
|
+
--ss-hero-content: var(--color-brand-content);
|
|
113
|
+
--ss-tone-content: var(--color-brand-content);
|
|
114
|
+
--ss-eyebrow-color: var(--color-brand-content);
|
|
115
|
+
color: var(--color-brand-content);
|
|
106
116
|
|
|
107
117
|
&:not(.ss-hero--background-svg)::before,
|
|
108
118
|
&.ss-hero--background-svg:not(.ss-hero--theme-1)::before {
|
|
@@ -111,20 +121,47 @@
|
|
|
111
121
|
background:
|
|
112
122
|
linear-gradient(
|
|
113
123
|
90deg,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
124
|
+
color-mix(
|
|
125
|
+
in srgb,
|
|
126
|
+
var(--ss-hero-image-overlay, #021543) 90%,
|
|
127
|
+
transparent
|
|
128
|
+
)
|
|
129
|
+
0%,
|
|
130
|
+
color-mix(
|
|
131
|
+
in srgb,
|
|
132
|
+
var(--ss-hero-image-overlay, #021543) 76%,
|
|
133
|
+
transparent
|
|
134
|
+
)
|
|
135
|
+
46%,
|
|
136
|
+
color-mix(
|
|
137
|
+
in srgb,
|
|
138
|
+
var(--ss-hero-image-overlay, #021543) 42%,
|
|
139
|
+
transparent
|
|
140
|
+
)
|
|
141
|
+
100%
|
|
117
142
|
),
|
|
118
143
|
linear-gradient(
|
|
119
144
|
180deg,
|
|
120
|
-
|
|
121
|
-
|
|
145
|
+
color-mix(
|
|
146
|
+
in srgb,
|
|
147
|
+
var(--ss-hero-image-overlay, #021543) 24%,
|
|
148
|
+
transparent
|
|
149
|
+
),
|
|
150
|
+
color-mix(
|
|
151
|
+
in srgb,
|
|
152
|
+
var(--ss-hero-image-overlay, #021543) 56%,
|
|
153
|
+
transparent
|
|
154
|
+
)
|
|
122
155
|
);
|
|
123
156
|
}
|
|
124
157
|
}
|
|
125
158
|
}
|
|
126
159
|
|
|
127
160
|
.ss-hero--theme-1 {
|
|
161
|
+
--ss-hero-content: var(--color-brand-content);
|
|
162
|
+
--ss-tone-content: var(--color-brand-content);
|
|
163
|
+
--ss-eyebrow-color: var(--color-brand-content);
|
|
164
|
+
color: var(--color-brand-content);
|
|
128
165
|
background-color: var(--color-hero-navy);
|
|
129
166
|
background-image:
|
|
130
167
|
radial-gradient(
|
|
@@ -6,6 +6,7 @@ import Footer from '../../components/organisms/Footer/Footer.astro';
|
|
|
6
6
|
import type { SiteConfig } from '../../../../lib/sproutsite/types.js';
|
|
7
7
|
import { canonicalUrl, withBase } from '../../../../lib/sproutsite/urls.js';
|
|
8
8
|
import { resolveBranding } from '../../branding.js';
|
|
9
|
+
import { colorStyles } from '../../colors.js';
|
|
9
10
|
interface Props {
|
|
10
11
|
site: SiteConfig;
|
|
11
12
|
title: string;
|
|
@@ -28,10 +29,14 @@ const canonical = noindex
|
|
|
28
29
|
: canonicalUrl(route, site);
|
|
29
30
|
const branding = await resolveBranding(site);
|
|
30
31
|
const socialImage = branding.sharingImage;
|
|
32
|
+
const paletteStyles = colorStyles(
|
|
33
|
+
site.colors,
|
|
34
|
+
`site configuration (${site.i18n.locale})`,
|
|
35
|
+
);
|
|
31
36
|
---
|
|
32
37
|
|
|
33
38
|
<!doctype html>
|
|
34
|
-
<html lang={site.i18n.locale} data-theme="sproutsite">
|
|
39
|
+
<html lang={site.i18n.locale} data-theme="sproutsite" style={paletteStyles}>
|
|
35
40
|
<head>
|
|
36
41
|
<meta charset="utf-8" />
|
|
37
42
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
@@ -10,16 +10,20 @@
|
|
|
10
10
|
}
|
|
11
11
|
.tone-brand {
|
|
12
12
|
@apply bg-primary text-primary-content;
|
|
13
|
-
--ss-eyebrow-color: var(
|
|
13
|
+
--ss-eyebrow-color: var(
|
|
14
|
+
--ss-tone-content,
|
|
15
|
+
var(--color-primary-content)
|
|
16
|
+
);
|
|
14
17
|
|
|
15
18
|
.content-prose {
|
|
16
19
|
&,
|
|
17
20
|
:where(h2, h3, h4, p, li, strong, code):not(:where(.ss-tabs *)) {
|
|
18
|
-
|
|
21
|
+
color: var(--ss-tone-content, var(--color-primary-content));
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
a:not(:where(.ss-tabs *)) {
|
|
22
|
-
@apply
|
|
25
|
+
@apply decoration-current;
|
|
26
|
+
color: var(--ss-tone-content, var(--color-primary-content));
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
:not(pre) > code:not(:where(.ss-tabs *)) {
|