@contentrain/astro-kit 0.27.2 → 0.28.1
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 +8 -1
- package/catalog.json +2 -0
- package/components/_shared/Section.astro +2 -1
- package/components/card-grid/CardGrid.astro +2 -2
- package/components/feature-list/FeatureList.astro +1 -1
- package/components/post-card/PostCard.astro +3 -3
- package/components/team/Team.astro +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -46,9 +46,16 @@ Each component lives in `components/<id>/`:
|
|
|
46
46
|
Components use colour roles and widths, never raw values. A site defines them
|
|
47
47
|
in `@theme` (the starter already does): `--color-surface`,
|
|
48
48
|
`--color-surface-muted`, `--color-ink`, `--color-ink-muted`, `--color-line`,
|
|
49
|
-
`--color-accent`, `--color-accent-ink`, `--
|
|
49
|
+
`--color-accent`, `--color-accent-ink`, `--color-accent-text`,
|
|
50
|
+
`--color-accent-text-inverse`, `--font-sans`, `--container-prose`,
|
|
50
51
|
`--container-page`, `--container-wide` and `--radius-card`.
|
|
51
52
|
|
|
53
|
+
Text in the accent (an eyebrow, a category link) reads `--color-accent-text`, never
|
|
54
|
+
`--color-accent`: an accent picked for fills can be too light for text on the page.
|
|
55
|
+
The starter sets it to the accent; a site whose accent does not reach 4.5:1 on its
|
|
56
|
+
surface sets a readable one. A dark section (`tone="inverse"`) reads
|
|
57
|
+
`--color-accent-text-inverse` in its place.
|
|
58
|
+
|
|
52
59
|
A migrated site also carries its theme's type and shape, and components read
|
|
53
60
|
these with a fallback to the kit's own values, so a site without them looks
|
|
54
61
|
unchanged:
|
package/catalog.json
CHANGED
|
@@ -10,7 +10,8 @@ const section = tv({
|
|
|
10
10
|
tone: {
|
|
11
11
|
default: 'bg-surface text-ink',
|
|
12
12
|
muted: 'bg-surface-muted text-ink',
|
|
13
|
-
|
|
13
|
+
// A dark band reads the accent's text colour made for it (`--color-accent-text-inverse`).
|
|
14
|
+
inverse: 'bg-ink text-surface [--color-accent-text:var(--color-accent-text-inverse)]',
|
|
14
15
|
accent: 'bg-accent text-accent-ink',
|
|
15
16
|
// The site's brand colour where it is not the accent (a band the source paints in the builder's own colour).
|
|
16
17
|
brand: 'bg-brand text-brand-ink',
|
|
@@ -72,10 +72,10 @@ const headingId = title ? `cards-${title.toLowerCase().replace(/[^a-z0-9]+/g, '-
|
|
|
72
72
|
{items.map(item => (
|
|
73
73
|
<li class={card()}>
|
|
74
74
|
{imageOf(item.image, item.imageAlt) && <div class={media()}><KitImage image={imageOf(item.image, item.imageAlt)!} sizes="(min-width: 1024px) 33vw, (min-width: 640px) 50vw, 100vw" class="aspect-[3/2] w-full object-cover transition duration-300 group-hover:scale-[1.02]" /></div>}
|
|
75
|
-
{item.eyebrow && <p class="text-sm font-medium text-accent">{item.eyebrow}</p>}
|
|
75
|
+
{item.eyebrow && <p class="text-sm font-medium text-accent-text">{item.eyebrow}</p>}
|
|
76
76
|
<CardHeading class={cardTitle()}>
|
|
77
77
|
{item.href
|
|
78
|
-
? <a href={item.href} class="text-current no-underline after:absolute after:inset-0 after:content-[''] hover:text-accent">{item.title}</a>
|
|
78
|
+
? <a href={item.href} class="text-current no-underline after:absolute after:inset-0 after:content-[''] hover:text-accent-text">{item.title}</a>
|
|
79
79
|
: item.title}
|
|
80
80
|
</CardHeading>
|
|
81
81
|
{item.text && <p class={text({ class: dim })} data-kit-text>{item.text}</p>}
|
|
@@ -8,7 +8,7 @@ const list = tv({
|
|
|
8
8
|
slots: {
|
|
9
9
|
grid: 'grid gap-x-8 gap-y-10 sm:grid-cols-2',
|
|
10
10
|
item: 'flex gap-4',
|
|
11
|
-
mark: 'flex size-6 shrink-0 items-center justify-center text-accent',
|
|
11
|
+
mark: 'flex size-6 shrink-0 items-center justify-center text-accent-text',
|
|
12
12
|
title: 'text-lg leading-snug [font-weight:var(--font-weight-heading,600)] text-balance',
|
|
13
13
|
text: 'mt-1 opacity-80',
|
|
14
14
|
},
|
|
@@ -29,7 +29,7 @@ const card = tv({
|
|
|
29
29
|
},
|
|
30
30
|
byline: {
|
|
31
31
|
inline: {},
|
|
32
|
-
below: { meta: 'text-xs font-semibold text-accent' },
|
|
32
|
+
below: { meta: 'text-xs font-semibold text-accent-text' },
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
defaultVariants: { layout: 'vertical', surface: 'plain', byline: 'inline' },
|
|
@@ -75,13 +75,13 @@ const Heading = `h${headingLevel}` as 'h2' | 'h3'
|
|
|
75
75
|
)}
|
|
76
76
|
{!below && (category || date) && (
|
|
77
77
|
<p class={slots.meta()}>
|
|
78
|
-
{category && <a href={category.href} class="relative z-10 font-medium text-accent no-underline hover:underline">{category.label}</a>}
|
|
78
|
+
{category && <a href={category.href} class="relative z-10 font-medium text-accent-text no-underline hover:underline">{category.label}</a>}
|
|
79
79
|
{category && date && <span aria-hidden="true">·</span>}
|
|
80
80
|
{date && <time datetime={date.toISOString()}>{shown}</time>}
|
|
81
81
|
</p>
|
|
82
82
|
)}
|
|
83
83
|
<Heading class={slots.title({ class: linkTitle ? 'text-[color:var(--color-link,var(--color-accent))]' : undefined })}>
|
|
84
|
-
<a href={href} class="text-current no-underline after:absolute after:inset-0 after:content-[''] hover:text-accent">{title}</a>
|
|
84
|
+
<a href={href} class="text-current no-underline after:absolute after:inset-0 after:content-[''] hover:text-accent-text">{title}</a>
|
|
85
85
|
</Heading>
|
|
86
86
|
{below && (author || date) && (
|
|
87
87
|
<p class={slots.meta()}>
|
|
@@ -15,7 +15,7 @@ const team = tv({
|
|
|
15
15
|
member: 'group relative flex flex-col gap-3',
|
|
16
16
|
portrait: 'overflow-hidden rounded-[var(--radius-image,var(--radius-card))]',
|
|
17
17
|
name: 'text-lg leading-snug [font-weight:var(--font-weight-heading,600)]',
|
|
18
|
-
role: 'text-sm font-medium text-accent',
|
|
18
|
+
role: 'text-sm font-medium text-accent-text',
|
|
19
19
|
bio: 'text-pretty opacity-80',
|
|
20
20
|
},
|
|
21
21
|
variants: {
|
|
@@ -75,7 +75,7 @@ const NameHeading = heading ? 'h3' : 'h2'
|
|
|
75
75
|
{imageOf(member.image, member.imageAlt ?? member.name) && <div class={s.portrait()}><KitImage image={imageOf(member.image, member.imageAlt ?? member.name)!} sizes="(min-width: 1024px) 25vw, (min-width: 640px) 50vw, 100vw" class="aspect-square w-full object-cover" /></div>}
|
|
76
76
|
<NameHeading class={s.name()}>
|
|
77
77
|
{member.href
|
|
78
|
-
? <a href={member.href} class="text-current no-underline after:absolute after:inset-0 after:content-[''] hover:text-accent">{member.name}</a>
|
|
78
|
+
? <a href={member.href} class="text-current no-underline after:absolute after:inset-0 after:content-[''] hover:text-accent-text">{member.name}</a>
|
|
79
79
|
: member.name}
|
|
80
80
|
</NameHeading>
|
|
81
81
|
{member.role && <p class={s.role()}>{member.role}</p>}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentrain/astro-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Copy-in Astro components for Contentrain sites (shadcn model): typed props, tailwind-variants, zero JavaScript by default — with a machine-readable catalog",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"mapping"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@contentrain/types": "1.
|
|
45
|
+
"@contentrain/types": "1.54.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.10.0",
|