Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Polished website sections for Astro, distributed as source you own. Every block
Astro Blocks is a [shadcn](https://ui.shadcn.com/docs/registry)-compatible registry. Installing a block copies ordinary, editable files into your project. Nothing stays linked: no runtime package, no hidden updates. Change anything.

```sh
npx shadcn@latest add lambda-curry/astro-blocks/hero-split#v0.1.17
npx shadcn@latest add lambda-curry/astro-blocks/hero-split#v0.1.18
```

That writes `src/components/blocks/HeroSplit.astro` and its one dependency, `src/components/ui/Button.astro`. It works in any Astro project, without Tailwind, React or a `components.json`. Then:
Expand Down Expand Up @@ -39,17 +39,17 @@ import HeroSplit from "../components/blocks/HeroSplit.astro";
List, search or inspect them from the CLI:

```sh
npx shadcn@latest list lambda-curry/astro-blocks#v0.1.17
npx shadcn@latest view lambda-curry/astro-blocks/timeline#v0.1.17
npx shadcn@latest list lambda-curry/astro-blocks#v0.1.18
npx shadcn@latest view lambda-curry/astro-blocks/timeline#v0.1.18
```

Each item in [`registry.json`](registry.json) says when to use it and, as importantly, when not to. A numbered list is for a real sequence, a bento grid is for related items of different weight, and a giant footer wordmark is for a short name on an otherwise quiet site.

## Design

- **Tokens, not themes.** Blocks read semantic custom properties: `--color-bg`, `--color-surface`, `--color-text`, `--color-muted`, `--color-accent`, `--color-on-accent`, `--font-display`, `--font-body`, the `--step-*` type scale, `--leading-display` and `--leading-tight`, `--space-gutter`, `--section-gap`, `--radius-sm` and `--radius-lg`. Set them once, in your own theme, and every block follows. Each block also falls back to the neutral defaults in [`tokens.css`](src/styles/tokens.css) (`npx shadcn@latest add lambda-curry/astro-blocks/tokens#v0.1.17`), so nothing breaks without them. One more is optional and absent from `tokens.css`: `--color-rule` recolors every structural hairline (row and table rules, dividers, header and footer rules, and the outlines of bars, panels and tiles). Unset, each keeps its own translucent mix of the text color. Write it with `currentColor`, such as `--color-rule: color-mix(in oklab, currentColor 20%, transparent)`, so rules stay right on inverse footers. Forms read one more optional token, `--color-error`, for error text, borders and the error summary. Unset, it is a red mixed with the text color, which measured at least 4.7:1 on the background and surface of the four gallery themes (default, paper, ink and grove). Check it against a theme with a strongly colored surface, and set the token there if needed.
- **Tokens, not themes.** Blocks read semantic custom properties: `--color-bg`, `--color-surface`, `--color-text`, `--color-muted`, `--color-accent`, `--color-on-accent`, `--font-display`, `--font-body`, the `--step-*` type scale, `--leading-display` and `--leading-tight`, `--space-gutter`, `--section-gap`, `--radius-sm` and `--radius-lg`. Set them once, in your own theme, and every block follows. Each block also falls back to the neutral defaults in [`tokens.css`](src/styles/tokens.css) (`npx shadcn@latest add lambda-curry/astro-blocks/tokens#v0.1.18`), so nothing breaks without them. One more is optional and absent from `tokens.css`: `--color-rule` recolors every structural hairline (row and table rules, dividers, header and footer rules, and the outlines of bars, panels and tiles). Unset, each keeps its own translucent mix of the text color. Write it with `currentColor`, such as `--color-rule: color-mix(in oklab, currentColor 20%, transparent)`, so rules stay right on inverse footers. Forms read one more optional token, `--color-error`, for error text, borders and the error summary. Unset, it is a red mixed with the text color, which measured at least 4.7:1 on the background and surface of the four gallery themes (default, paper, ink and grove). Check it against a theme with a strongly colored surface, and set the token there if needed.
- **Optional type.** Sixteen curated self-hosted typefaces, each its own `font-*` item installing a small stylesheet that loads pinned WOFF2 by sha256, plus three pairings built from them (`pairing-editorial`, `pairing-product`, `pairing-warm`) that set only type tokens. Installs stay on the system font until a site adds one. See [docs/type-pairings.md](docs/type-pairings.md) and the live specimens at `/typography`.
- **Optional design devices.** `screen-tone` (a token ramp through a dot, line, hatch or grain screen, or a threshold halftone), `seal` (an ink stamp for one real owner fact) and `annotated-figure` (numbered callouts with a key). Each is static, uses no JavaScript, and drops its decoration under forced colors and more contrast. `/techniques` renders them beside Site Boulder's six technique recipes in two contrasting brands, and each use there names its source and job.
- **Optional techniques.** Six visual devices in the `technique` category, each with one job. `cut-edges` (ticket notches, pinked and scalloped edges), `grain` (paper tooth and textured, band-free gradients) and `duotone` (two-token photo unification) are one small CSS file each: install it, `@import "./techniques/<name>.css";` in your theme, and tune it with custom properties. `screen-tone` (a token ramp through a printed dot, line or hatch screen, or a threshold halftone), `seal` (an ink stamp for one real owner fact) and `annotated-figure` (numbered callouts with a key) are components. All are static, use no JavaScript, and drop their decoration under forced colors (and, where it touches text, more contrast). `/techniques` renders each in two contrasting brands, plus compositions that pair several with different jobs.
- **Container queries.** Blocks lay out from the width they are given, so they work full-width or inside a narrow column.
- **Zero JS for static blocks; opt-in `@ui-sdk/web` for interactive blocks.** Narrow-screen menus use the HTML `popover` attribute, the transparent header turns solid via CSS scroll-driven animation, and the wordmark footer sizes with container units—shipping 0 B JS across all 32 static blocks. Only `detail-dialog`, `filter-collection`, and `compare-tray` import exact-pinned `@ui-sdk/core@0.1.0-beta.23` and `@ui-sdk/web@0.1.0-beta.23` in `<script>` tags.
- **Accessible by default.** One `h1` per page (heroes take `headingLevel`), visible focus, 44px targets, landmarks, alt text through props, and motion that respects `prefers-reduced-motion`.
Expand Down
11 changes: 8 additions & 3 deletions docs/blocks-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

**Form kit (2026-11-30, unreleased):** three `primitive` items for a site's own `<form>`, after an audit of AI-built sites found a 72px input beside a 56px one, a raw radio dot inside a filled pill, and a green banner above a re-armed empty form. `field` (one labelled native control), `choice-group` (radio or checkbox chips) and `form-status` (a receipt that replaces the form, or an error summary above it). No client JavaScript and no backend; `action` and `method` stay on the site's form. Measured on a scratch page at 390 and 1440, with and without a `box-sizing` reset: two fields side by side, one with a wrapping error and one with a hint, keep identical control tops and heights (44px at 390, 46.4px at 1440), as do date beside select and url beside number, in a grid and in a stretching flex row. Chips and error-summary links are 44px tall. Contrast, lowest of default, paper, ink and grove: error text 4.78 (grove, on the surface), control and chip borders 3.62 (grove, on the surface). `--color-border` in `tokens.css` measures 2.97 on white (2.75 in ink), under WCAG 1.4.11's 3:1, so controls draw their border from the text color instead. `header-minimal` gains a `brand` slot (the home link keeps `brand` as its accessible name); its default example renders 0 px different from v0.1.9 in all four themes at both widths, and below 44rem the brand and action share row 1 with the links on row 2. `npm run shots -- --themes default,paper,ink,grove --sheet --interact --stress field choice-group form-status header-minimal`: 0 problems.

**v0.1.18 (2026-12-02):** the installable visual vocabulary becomes one `technique` category. **New CSS items** (`technique`, `0.1.0`, `placement: inline`), each one small stylesheet under `src/styles/techniques/`, installed with `registry_add` and imported from the theme: **`cut-edges`**, **`grain`** and **`duotone`**, carried over from Site Boulder's render-checked recipe cards with the selectors and invariants unchanged: notches cut a decorative `::before` so content and focus rings are never cropped, `:dir(rtl)` mirroring, a 1px `CanvasText` outline under forced colors, an `@supports` oklab ramp with the `--ramp-solid`/`--ramp-ink` pair under `prefers-contrast: more`, and a greyscale fallback for duotone under forced colors. The only edits: explicit token fallbacks (required by the build), and the card's bare `.ticket` rule scoped to `.cut.ticket`. **Recategorised:** `screen-tone`, `seal` and `annotated-figure` move from `primitive` to `technique` (sources unchanged). `screen-tone` drops its `grain`, `grainy gradient` and `textured gradient` tags, which now belong to `grain`, and each docs line points to the other. **`hero-typographic`:** `useWhen` and `summary` frame the words as the focal material (a poster headline, or real hours and terms), no longer a fallback for missing imagery. **Build:** `technique` is a valid category, and usage rewrites `import "../../styles/` for a page in `src/pages/`. **Gallery:** `/techniques` imports the three stylesheets the registry installs instead of inlining them, drops the one-surface-one-device cap in favor of "each technique needs its own source and job", and adds *Techniques working together*: a restrained editorial quarterly (duotone and seal), a bakery (grain and a scalloped slip) and a single-screen cinema (grain ramp, screen tone and ticket stubs). The index gains a Techniques category. `CodeBlock`'s Copy button no longer wraps mid-word at 390px (`white-space: nowrap`, `flex-shrink: 0`). **Platform follow-up:** Site Boulder's `registry_search` ranks only `foundation` and `primitive` items after sections, so `technique` items now lead an unfiltered browse until its pinned snapshot and that rule are updated.

**v0.1.17 (2026-12-02):** three optional design devices from SBO-18's design-primitives research, all `primitive` `0.1.0`, static and without client JavaScript. **`screen-tone`:** a two-token ramp through a dot, line, hatch or grain screen. `mask` mode lays a ground-colored sheet with the marks cut out over the ramp, so the ramp's stops stay fixed to the field however `--screen-angle` turns the screen (the rotated sheet is a square as wide as the field's diagonal). `--screen-fade` makes the textured-gradient fade. Hatch intersects two masks (`-webkit-mask-composite: source-in`, then `mask-composite: intersect`). `threshold` mode multiplies a grey ramp by a tonal pattern and cuts it with `contrast(20)`, so marks grow with tone; it is colored with `lighten` and printed with `multiply`, or with `darken` and `screen` when `ground="dark"`. **`seal`:** text on a circular `textPath`, spaced to the exact circumference by `textLength`, so the join is seamless; short facts repeat to fill the ring; over-long ring, center or kicker text fails the build. **`annotated-figure`:** marker coordinates are physical (`left`/`top`), because they belong to the image and must not mirror in RTL. Every marker is a dark plate with a light ring, readable on light and dark photos. Leaders are a light halo under a thin line, and the key is an `<ol role="list">`. All three drop their decoration under `forced-colors` and `prefers-contrast: more`. **`tokens` `0.1.6`:** the `--action-shadow` comment no longer offers a hard offset as its only example; values are unchanged. **Gallery:** `/techniques` renders all nine SBO-18 techniques in two fixture brands (Cedar Street Cycles, light; The Blue Lantern, dark), with the six merged recipe cards' CSS verbatim. Checks in Chromium at 1440, 390, forced colors, more contrast and reduced motion, for `/techniques` and the three block pages, plus the canvases in paper, ink and grove at both widths: 38 renders, 0 failed requests besides the workbench's missing favicon, 0 console errors, 0 horizontal overflow. Text contrast: 64 distinct text styles, lowest on a solid ground 6.56:1; text over ramps at least 8.09:1 at the stops it crosses. **Found while verifying:** a `view()` scroll accent inside an `overflow: hidden` ancestor never moves, because the ancestor becomes its scroll container. The gallery panel and `screen-tone` use `overflow: clip`.

**v0.1.15 (2026-12-01):** from SBO-18's research into 28 live sites (brief: https://arborthreads.com/artifacts/art_375e57b2-69d4-4542-881a-ede2e59b35b3). **New `gallery`** (`0.1.0`, `content`): captioned images in reading order. The `sequence` layout spans wide images and sets square (74%) and tall (54%) ones narrower, centered or alternating. There is also a `grid` contact sheet with an optional crop ratio and a `rail` that is keyboard-scrollable once focused. A `pair` keeps before and after (or object and making) side by side above 34rem. The optional static counter reads "03 / 12". Every image is a `<figure>` with a `<figcaption>`, alt is required and width/height reserve space. No client JS. **`collection` `0.1.3`** gains `layout="links"`: top tasks as a verb phrase plus one line of scent, whole-row targets, and at most `--_columns` columns chosen from the item count (up to 4 in one row, then 4 or 3 across, whichever divides the set or leaves at least two on the last row), each at least 15rem; at narrower widths, where fewer columns fit, an odd count such as 7 can still leave one task alone; the other layouts are unchanged. **Every item but `tokens` gains `meta.summary`**: the job-plus-key-props line Site Boulder shows agents before they search, emitted as `summary` in `catalog.json`. The build fails if it is missing, over 160 characters, or names a prop, slot or object field the component lacks. **Tags:** job words added (facts: hours, address, location; schedule: classes, lineup, calendar; features-editorial: prices; field: rsvp, newsletter) and sector-only tags removed from headers, heroes, walkthroughs, features and footers, because they collided with job words in search. `finder` was prototyped and held for a real use case. Checks: `npm run shots -- --themes default,paper,ink,grove --contrast --sheet --interact --stress gallery collection`: 0 problems, lowest token pair 5.66 (paper, muted on surface). Gallery credits read the muted token at full opacity: 6.79 default, 6.31 paper; an 85% opacity draft measured 4.46 on paper and was removed. Rail: two ArrowRight presses scrolled 688px with a visible ring. **Release review fixes** (from independent design and exact-head code reviews of 6bdf9d4 and a re-check of c478a8e):
Expand Down Expand Up @@ -85,9 +87,12 @@ Every registry item is accounted for. `tokens` has no canvas, so it is covered b
| field | primitive | | ✓ | 11 |
| choice-group | primitive | | ✓ | 13 |
| form-status | primitive | button | ✓ | 19 |
| screen-tone | primitive | | ✓ | 3 |
| seal | primitive | | ✓ | 2 |
| annotated-figure | primitive | | ✓ | 14 |
| screen-tone | technique | | ✓ | 3 |
| seal | technique | | ✓ | 2 |
| annotated-figure | technique | | ✓ | 14 |
| cut-edges | technique | | ✓ | 4 |
| grain | technique | | ✓ | 3 |
| duotone | technique | | ✓ | 2 |
| header-floating | header | button | ✓ + stage | 16 |
| header-editorial | header | button | ✓ + stage | 12 |
| header-transparent | header | button | ✓ + stage | 14 |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro-blocks",
"version": "0.1.17",
"version": "0.1.18",
"private": true,
"description": "Open-source, Astro-first, shadcn-compatible source registry of polished website blocks.",
"license": "MIT",
Expand Down
5 changes: 3 additions & 2 deletions public/r/annotated-figure.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"explainer",
"how it works",
"figure",
"photo"
"photo",
"technique"
],
"useWhen": "A picture has a job: what a service checks on a bike, which farm each ingredient on a plate comes from, where the step-free entrance and the stage are in a room. Every marker carries a fact the key states in words.",
"avoidWhen": "Markers would be decoration, or there is no picture worth pointing at; a plain list reads better. Keep it under about nine markers, and don't cover faces or the part the marker names.",
Expand All @@ -36,7 +37,7 @@
},
"docs": "Import from src/components/ui/AnnotatedFigure.astro. Pass image for a photo, or put an SVG diagram in the default slot. markers are numbered in order; each has x and y (percentages of the figure, 0 to 100) where its number sits, a label and text for the key, an optional point that a leader line runs to, and an optional href that makes the marker a link with a 44px target. The key is an ordered list named by keyLabel; it sits beside the figure when the container is 44rem or wider (layout=\"beside\") or always below it (layout=\"below\"). The image keeps its natural aspect ratio so markers stay on their spot; don't crop it with object-fit. Knobs: --marker-bg and --marker-ink (text and background by default), --marker-size.",
"categories": [
"primitive"
"technique"
],
"type": "registry:item"
}
4 changes: 2 additions & 2 deletions public/r/article.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"author": "Lambda Curry <https://github.com/lambda-curry>",
"description": "A long-form reading layout: a strong title and dek over quiet facts, an optional lead figure with a caption, prose styles for the body and a contents list that becomes a sticky rail on wide screens.",
"registryDependencies": [
"lambda-curry/astro-blocks/breadcrumbs#v0.1.17",
"lambda-curry/astro-blocks/pager#v0.1.17"
"lambda-curry/astro-blocks/breadcrumbs#v0.1.18",
"lambda-curry/astro-blocks/pager#v0.1.18"
],
"files": [
{
Expand Down
4 changes: 2 additions & 2 deletions public/r/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"author": "Lambda Curry <https://github.com/lambda-curry>",
"description": "An index of things the visitor opens, such as articles, events, projects, records or top tasks: image-led cards in as many columns as fit, ruled rows with a date rail, or a compact grid of task links. Each card or row is one link.",
"registryDependencies": [
"lambda-curry/astro-blocks/button#v0.1.17",
"lambda-curry/astro-blocks/pager#v0.1.17"
"lambda-curry/astro-blocks/button#v0.1.18",
"lambda-curry/astro-blocks/pager#v0.1.18"
],
"files": [
{
Expand Down
Loading
Loading