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
9 changes: 5 additions & 4 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.16
npx shadcn@latest add lambda-curry/astro-blocks/hero-split#v0.1.17
```

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,16 +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.16
npx shadcn@latest view lambda-curry/astro-blocks/timeline#v0.1.16
npx shadcn@latest list lambda-curry/astro-blocks#v0.1.17
npx shadcn@latest view lambda-curry/astro-blocks/timeline#v0.1.17
```

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.16`), 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.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.
- **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.
- **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
5 changes: 5 additions & 0 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.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):
- **gallery alignment:** the centring and alternating rules apply only to `sequence`. All rail images now share one top edge, and pair figures keep their own alignment.
- **gallery viewport cap:** sequence figures are capped at 80svh × their aspect ratio, so each fits the viewport with its caption at 1440×900 and 1280×720. Pairs get the same cap at twice the width (774px and 646px tall at 1440×900 and 1280×720).
Expand Down Expand Up @@ -83,6 +85,9 @@ 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 |
| 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.16",
"version": "0.1.17",
"private": true,
"description": "Open-source, Astro-first, shadcn-compatible source registry of polished website blocks.",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions public/gallery/motif-chainring.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/gallery/motif-lantern.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading