cssints 0.35.0 → 0.36.0
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 -2
- package/dist/clay-types.d.mts +1 -1
- package/docs/API.md +7 -7
- package/package.json +2 -2
- package/skills/cssints-plugin/references/table.md +1 -1
package/README.md
CHANGED
|
@@ -148,7 +148,7 @@ export const Row = ({ wide, on }: { wide?: boolean; on?: boolean }) => (
|
|
|
148
148
|
|
|
149
149
|
### In a terminal
|
|
150
150
|
|
|
151
|
-
`import * as css from "cssints/tui" with { type: "cssints" }` gives the members a terminal has (cells, colours, borders, flex, states, `cursor`), and the plugin compiles them to prop objects for [OpenTUI](https://opentui.com) renderables instead of classes; `@cssints/tui` applies their states and themes: [packages/tui](packages/tui/README.md), docs/API.md "TUI". The package to apply them, `@cssints/tui`, is **deprecated** in favour of the terminal target in [`native
|
|
151
|
+
`import * as css from "cssints/tui" with { type: "cssints" }` gives the members a terminal has (cells, colours, borders, flex, states, `cursor`), and the plugin compiles them to prop objects for [OpenTUI](https://opentui.com) renderables instead of classes; `@cssints/tui` applies their states and themes: [packages/tui](packages/tui/README.md), docs/API.md "TUI". The package to apply them, `@cssints/tui`, is **deprecated** in favour of the terminal target in [`cssints-native`](https://github.com/alexeiaccio/cssints-native) (Clay in cells, termbox2, the `terminal/` directory of that package); its README says what carries over and how to run the replacement.
|
|
152
152
|
|
|
153
153
|
More in [docs/API.md](docs/API.md): property names and short names, `flex()` and `grid()` chains, conditions and layers, tokens and themes, `cn` and `cv`, and the errors you can get.
|
|
154
154
|
|
|
@@ -183,7 +183,7 @@ and Cursor. The skills use it when it is configured and work without it.
|
|
|
183
183
|
| `packages/mise-en-mode` | `@cssints/mise-en-mode`: looks as themes in the layers app < author < viewer, on `data-mode` scopes, checked against the tokens and by `check.contrast` |
|
|
184
184
|
| `packages/headless` | `@cssints/headless`: headless APG widgets on Solid 2 (state and DOM attribute objects, no styling), conformance-checked against Quint specs; not published yet |
|
|
185
185
|
| `packages/apg-specs` | `@cssints/apg-specs`: the APG and canvas Quint specs, generated models, scenario bridges and ported scenarios the widgets are tested against (the test oracle, published) |
|
|
186
|
-
| `packages/tui` | `@cssints/tui` (**deprecated**): the runtime of `cssints/tui` styles on OpenTUI and @bomb.sh/tty; `native
|
|
186
|
+
| `packages/tui` | `@cssints/tui` (**deprecated**): the runtime of `cssints/tui` styles on OpenTUI and @bomb.sh/tty; `cssints-native`'s terminal target replaces it |
|
|
187
187
|
| `apps/demo` | React demo of every 0.1 feature |
|
|
188
188
|
| `apps/docs` | The documentation site: this file and `docs/API.md` as pages, with search and type hovers (`cd apps/docs && bun run dev`) |
|
|
189
189
|
| `docs/research`, `docs/archive` | Comparisons with other libraries; outdated plans |
|
package/dist/clay-types.d.mts
CHANGED
|
@@ -280,7 +280,7 @@ export declare const shadow: (options?: ShadowOptions) => ClayStyle;
|
|
|
280
280
|
* A backdrop of the element: the content under it is blurred, then the element is drawn over it, so a translucent fill
|
|
281
281
|
* is glass over our own page (the desktop behind the window is out of reach). A renderer effect, not a Clay field, as
|
|
282
282
|
* `shadow` is: `header()` prints nothing for it and only a renderer that reads it draws one. The element needs an `id`.
|
|
283
|
-
* Today `native
|
|
283
|
+
* Today `cssints-native`'s `solid/` ThorVG renderer is the one that blurs.
|
|
284
284
|
*/
|
|
285
285
|
export declare const backdrop: (options?: BackdropOptions) => ClayStyle;
|
|
286
286
|
/**
|
package/docs/API.md
CHANGED
|
@@ -1674,7 +1674,7 @@ f812d87e (headless: a data table with sortable headers and row selection)
|
|
|
1674
1674
|
|
|
1675
1675
|
### Headless: `createVirtualizer` (`@cssints/headless`)
|
|
1676
1676
|
|
|
1677
|
-
A window over a list of thousands: the host renders the visible rows plus an overscan, and two spacer boxes stand in for the rest, so the declared DOM, the content height and the scroll's clamp and thumb are the whole list's. It ports the rules the native renderer had (`native
|
|
1677
|
+
A window over a list of thousands: the host renders the visible rows plus an overscan, and two spacer boxes stand in for the rest, so the declared DOM, the content height and the scroll's clamp and thumb are the whole list's. It ports the rules the native renderer had (`cssints-native`'s `solid/src/virtual.ts`: `fixedWindow`, `measuredWindow`, `OVERSCAN` and the gap-compensated spacers); the DOM adds the scrollport (`attach`), a `ResizeObserver` (the native renderer reads a row's box from `ui.bounds` after layout, which the DOM has no equivalent of) and the ARIA pair on every declared row. **No APG pattern exists for virtualisation and no Quint machine**: the state is pixels, not items, so `packages/headless/test/virtual.browser.test.tsx` is the oracle.
|
|
1678
1678
|
|
|
1679
1679
|
```ts skip
|
|
1680
1680
|
createVirtualizer(options: {
|
|
@@ -4330,7 +4330,7 @@ An inspector in the page, built on what the dev server knows of every class. In
|
|
|
4330
4330
|
export default defineConfig({ plugins: [cssints({ devtools: true })] });
|
|
4331
4331
|
```
|
|
4332
4332
|
|
|
4333
|
-
Alt+Shift+C, or the `cssints` button in the bottom right corner, opens it. Hovering an element previews it, a click picks it; ↑ is the parent, ↓ the first child, ← and → the siblings; Esc stops picking, then closes. For the demo's action button, hovered in a 1300 px window, the panel shows:
|
|
4333
|
+
Alt+Shift+C, or the `cssints` button in the bottom right corner, opens it. Hovering an element previews it, a click picks it; ↑ is the parent, ↓ the first child, ← and → the siblings; Esc stops picking, then closes. `x`, or the `xray` button, cycles the X-ray: the picked element, its subtree, the whole page, then off. It draws the boxes with their border-box size, padding, border, radii, flex/grid gap and the spaces between siblings, on a 4 px grid inside the root, and the panel repeats the numbers under X-RAY. Everything is read from the page (`getBoundingClientRect`, `getComputedStyle`), so it follows a hover or a scroll; the page is capped at 400 boxes and draws no grid. For the demo's action button, hovered in a 1300 px window, the panel shows:
|
|
4334
4334
|
|
|
4335
4335
|
```text skip
|
|
4336
4336
|
button pick ↑ ×
|
|
@@ -4509,11 +4509,11 @@ const { ratio, text } = await Effect.runPromise(contrast("#777", "white"));
|
|
|
4509
4509
|
|
|
4510
4510
|
> **Deprecated.** The members below still compile, and `@cssints/tui` still applies them, but importing it now prints
|
|
4511
4511
|
> one warning, and the package will not get new members. A terminal app builds on
|
|
4512
|
-
> [`native
|
|
4512
|
+
> [`cssints-native`](https://github.com/alexeiaccio/cssints-native) instead: its `terminal/` takes `cssints/clay` styles
|
|
4513
4513
|
> (`generator/clay-header.ts` → a C header), lays them out with [Clay](https://github.com/nicbarker/clay) and draws them
|
|
4514
4514
|
> into character cells on [termbox2](https://github.com/termbox/termbox2), with the keyboard focus layer in C
|
|
4515
4515
|
> (`terminal/focus.c`). What carries over and what does not, and the commands that run it, are in
|
|
4516
|
-
> [packages/tui/README.md](../packages/tui/README.md); `
|
|
4516
|
+
> [packages/tui/README.md](../packages/tui/README.md); that repository's `docs/map.md` step 6 is the full account.
|
|
4517
4517
|
|
|
4518
4518
|
A terminal app writes its styles with `cssints/tui`, and the same Vite plugin compiles them to **prop objects** for terminal renderables, not to classes: there is no sheet and no cascade. `@cssints/tui` applies them (states, the mouse pointer, the caret, themes); its adapters are [OpenTUI](https://opentui.com) and [@bomb.sh/tty](https://bomb.sh/docs/tty/api/). The design, the full property table and what is out of scope are in [research/tui.md](research/tui.md).
|
|
4519
4519
|
|
|
@@ -4740,7 +4740,7 @@ css.image("logo.png", { width: 64, height: 32, fit: "cover" }); // error: fill o
|
|
|
4740
4740
|
static const Clay_ElementDeclaration glyph = { .layout = { .sizing = { .width = { .size = { .minMax = { 32, 32 } }, .type = CLAY__SIZING_TYPE_FIXED }, .height = { .size = { .minMax = { 32, 32 } }, .type = CLAY__SIZING_TYPE_FIXED } } }, .image = { .imageData = (void *)"examples/sensors/glyph.png" } };
|
|
4741
4741
|
```
|
|
4742
4742
|
|
|
4743
|
-
- **Shadows** (2026-10-23): `shadow({ x, y, blur, color })` is a renderer effect, not a Clay field — `Clay_ElementDeclaration` has none in Clay 1.0. The declaration keeps its layout, the literal carries the shadow as a sibling key (as an image's path does), and `header()` prints nothing for it, so the C targets are unchanged and ignore it until a page's own renderer draws it. The shadow is the element's own box, moved by `x`/`y` and filled with `color`, its edge softened by `blur` (CSS's `box-shadow` reading, in pixels: the gaussian's sigma is half of it), drawn before the element's own command so the element covers the middle of it. The desktop renderer (`native
|
|
4743
|
+
- **Shadows** (2026-10-23): `shadow({ x, y, blur, color })` is a renderer effect, not a Clay field — `Clay_ElementDeclaration` has none in Clay 1.0. The declaration keeps its layout, the literal carries the shadow as a sibling key (as an image's path does), and `header()` prints nothing for it, so the C targets are unchanged and ignore it until a page's own renderer draws it. The shadow is the element's own box, moved by `x`/`y` and filled with `color`, its edge softened by `blur` (CSS's `box-shadow` reading, in pixels: the gaussian's sigma is half of it), drawn before the element's own command so the element covers the middle of it. The desktop renderer (`cssints-native`'s `solid/`) is the one that draws it today.
|
|
4744
4744
|
|
|
4745
4745
|
| Option | What the renderer draws | Default |
|
|
4746
4746
|
| ------------- | ------------------------------------------------------------------------- | ------------------ |
|
|
@@ -4776,7 +4776,7 @@ static const Clay_ElementDeclaration panel = { .layout = { .sizing = { .width =
|
|
|
4776
4776
|
| `blur` | blurs the element's box under it, not negative | 12 |
|
|
4777
4777
|
| — | no spread, no saturation or tint: only `blur`, and one an element | — |
|
|
4778
4778
|
|
|
4779
|
-
The desktop renderer (`native
|
|
4779
|
+
The desktop renderer (`cssints-native`'s `solid/`) is the only one that draws a backdrop today; the box is the element's first rectangle command, clipped to the canvas, and nothing is blurred outside it. The blur is three box passes each way on the CPU, on the region alone; on the Dialog page's 150x133 menu (blur 10) the frame's draw goes from 2.2 to 3.0 ms (Apple M2, one thread, back-to-back 300-frame runs), and the radius barely moves it — the frame's split into two draws is the cost. A panel may keep its own shadow: it is drawn before the blur, so it lies on the unblurred page, under the glass. The browser (a dual Kawase pass), the board and the terminal have none.
|
|
4780
4780
|
|
|
4781
4781
|
```ts
|
|
4782
4782
|
import * as css from "cssints/clay" with { type: "cssints" };
|
|
@@ -4797,7 +4797,7 @@ css.backdrop({ blur: "1rem" }); // error: a blur is pixels
|
|
|
4797
4797
|
static const Clay_ElementDeclaration menu = { .layout = { .sizing = { .width = { .size = { .minMax = { 150, 150 } }, .type = CLAY__SIZING_TYPE_FIXED } } }, .backgroundColor = { .r = 23, .g = 27, .b = 32, .a = 184 }, .cornerRadius = { .topLeft = 10, .topRight = 10, .bottomRight = 10, .bottomLeft = 10 } };
|
|
4798
4798
|
```
|
|
4799
4799
|
|
|
4800
|
-
- **Gradients** (2026-10-23): `backgroundImage("linear-gradient(...)")` fills the element's box with a linear gradient, written as CSS writes it — one string, the function, an optional direction, the stops. Clay 1.0 has no gradient field, so as `shadow` and `backdrop` are, it is a renderer effect: the declaration keeps its layout and its solid fill, the literal carries a sibling `backgroundImage: { kind: "linear", angle, stops: [{ offset, color: { r, g, b, a } }] }` key, `header()` prints nothing for it, the C targets draw the solid fill, and the desktop renderer (`native
|
|
4800
|
+
- **Gradients** (2026-10-23): `backgroundImage("linear-gradient(...)")` fills the element's box with a linear gradient, written as CSS writes it — one string, the function, an optional direction, the stops. Clay 1.0 has no gradient field, so as `shadow` and `backdrop` are, it is a renderer effect: the declaration keeps its layout and its solid fill, the literal carries a sibling `backgroundImage: { kind: "linear", angle, stops: [{ offset, color: { r, g, b, a } }] }` key, `header()` prints nothing for it, the C targets draw the solid fill, and the desktop renderer (`cssints-native`'s `solid/`) fills the box with the gradient instead of `backgroundColor`. **The element needs an `id`**, and a solid `backgroundColor` too: Clay emits a rectangle command for a box whose fill is not transparent, and that command is where the gradient goes (the solid is not drawn then).
|
|
4801
4801
|
|
|
4802
4802
|
| Part | What it is | Default |
|
|
4803
4803
|
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------- |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cssints",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "CSS in TypeScript: typed css.* calls compiled to atomic CSS at build time (a Vite plugin)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@cssints/css-grammar": "^0.
|
|
75
|
+
"@cssints/css-grammar": "^0.36.0",
|
|
76
76
|
"culori": "^4.0.2",
|
|
77
77
|
"effect": "4.0.6",
|
|
78
78
|
"happy-dom": "^20.14.6",
|
|
@@ -114,7 +114,7 @@ shade: fn({
|
|
|
114
114
|
- `value` runs at build time, once per call; the call is replaced by its CSS text. It throws for values the grammar
|
|
115
115
|
cannot reject (units it cannot compute, a failed accessibility rule): `fluid` rejects `em` and fails WCAG 1.4.4.
|
|
116
116
|
- What `value` returns must be a string or a Typed OM value (`cssints: tint() value must return a string or a Typed OM
|
|
117
|
-
|
|
117
|
+
value`). A result that does not fit the property is that property's error at the same site.
|
|
118
118
|
|
|
119
119
|
## Identity and HMR
|
|
120
120
|
|