@csszyx/mcp-server 0.15.3 → 0.17.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.
Files changed (2) hide show
  1. package/llms-full.txt +61 -9
  2. package/package.json +4 -4
package/llms-full.txt CHANGED
@@ -2691,6 +2691,21 @@ CSS custom properties (`--*`) are passed through unchanged.
2691
2691
  - Spaces in values are normalised to underscores: `repeat(3, 1fr)` → `repeat(3,_1fr)`.
2692
2692
  - Works inside `dynamic()` at runtime — the same compiler logic handles the `css` key.
2693
2693
 
2694
+ ### Custom property as a key
2695
+
2696
+ A CSS custom property may also be written as a key on the `sz` object itself, which is the shorter form when a token sits beside the utilities that read it. It produces the same class as the `css: {}` spelling and nests under a variant like any other key.
2697
+
2698
+ | Concept | Example `sz` Prop | Output Class | Note |
2699
+ | :------------------ | :------------------------------------ | :-------------------------- | :-------------------------------- |
2700
+ | **Key spelling** | `{ '--my-color': 'red' }` | `[--my-color:red]` | same class as `css: {}` |
2701
+ | **Inside variant** | `{ dark: { '--my-color': 'white' } }` | `dark:[--my-color:white]` | works in all variants |
2702
+ | **Numeric value** | `{ '--my-alpha': 0.18 }` | `[--my-alpha:0.18]` | numbers coerced to string |
2703
+ | **Spaced value** | `{ '--my-edge': '1px solid red' }` | `[--my-edge:1px_solid_red]` | spaces → underscores |
2704
+ | **Bracketed value** | `{ '--my-cols': '[a] 1fr [b]' }` | `[--my-cols:[a]_1fr_[b]]` | brackets kept as written |
2705
+ | **Case** | `{ '--MyToken': 1 }` | `[--MyToken:1]` | case kept; `--` is case-sensitive |
2706
+
2707
+ The value is a declaration value, so it is a string or a number; `false` switches the property off like any key. An object body has no declaration to lower and the type rejects it; nest a variant instead. A runtime value is hoisted like any other and read back as `[--my-color:var(--_sz---my-color)]`.
2708
+
2694
2709
 
2695
2710
  # Sizing
2696
2711
 
@@ -3890,6 +3905,27 @@ import { __szColorVar } from "csszyx/lite";
3890
3905
 
3891
3906
  ## Nested Element Routing — splitBox + class toolkit
3892
3907
 
3908
+ For className-only consumers, import `classify`, `has`, `pick`, `omit` and
3909
+ `splitBox` from `@csszyx/runtime/split`. The entry excludes sz-object adapters;
3910
+ ESM can tree-shake the main entry too, while CommonJS benefits from the narrower
3911
+ surface. The compiler dependency remains.
3912
+
3913
+ The supported vocabulary is atomic utilities. A multi-property custom
3914
+ `@utility card` is not classified: `pick` excludes it, `omit` retains it, and
3915
+ `splitBox` leaves it on the fallback node with a development warning unless
3916
+ explicitly placed. Use `splitBox('card p-4', { inner: ['card'] })` to place the
3917
+ whole class; no CSS declarations are split. Literal placement matches a whole
3918
+ base name, so `card` does not match `card-lg`. Use authored names when mangling.
3919
+ `{ outer: ['hidden'] }` matches every variant of `hidden`; naming `md:hidden`
3920
+ in a class placement list matches nothing and warns. Query helpers still
3921
+ require recognised selectors.
3922
+
3923
+ `scope` is the category for `group` and `peer`, including `group/item`. Both
3924
+ route outer: `group` supplies an ancestor and `peer` keeps its sibling position.
3925
+ The expanded vocabulary also recognises `placeholder-*` as inner and
3926
+ `start-*`/`end-*` as outer. These classes previously used the fallback, so
3927
+ review old routing assumptions and category-query expectations when upgrading.
3928
+
3893
3929
  When a caller passes one flat `className` to a component that renders nested elements, `splitBox` partitions it at the CSS box-model border line so each element gets the classes that act on it. Pure string functions, framework-agnostic. The class-token → box-role map is generated from the compiler's property tables (never drifts).
3894
3930
 
3895
3931
  ```tsx
@@ -3903,31 +3939,47 @@ import {
3903
3939
  stripSzProps,
3904
3940
  } from "@csszyx/runtime";
3905
3941
 
3906
- // Partition: outer = border-outward (margin/position/border/ring/sizing/bg/shadow/transform/visibility),
3907
- // inner = border-inward (padding/overflow/display/flex/grid/gap/text/interaction)
3942
+ // Partition: outer = border-outward (margin/position/border/ring/sizing/bg/shadow/transform/
3943
+ // visibility/overflow-hidden+clip/cursor/select/pointer-events/scroll-m/snap-start/align),
3944
+ // inner = border-inward (padding/overflow-auto+scroll/display/flex/grid/gap/text/divide/
3945
+ // perspective/transform-3d/resize/appearance)
3946
+ // Both: transition/duration/ease/delay are declared on BOTH nodes (a transition is inert until a
3947
+ // property changes, and the state that changes it can sit on either side).
3908
3948
  const { outer, inner } = splitBox("m-4 px-2 md:flex");
3909
3949
  // outer: "m-4" inner: "px-2 md:flex"
3910
3950
 
3951
+ // overflow routes by VALUE: hidden/clip clip the frame, auto/scroll scroll the content
3952
+ splitBox("overflow-hidden overflow-y-auto p-4");
3953
+ // outer: "overflow-hidden" inner: "overflow-y-auto p-4"
3954
+
3911
3955
  // Override any default per call (BoxSelector = box-role | category | class-prefix | { category: value })
3912
- splitBox("overflow-hidden p-4", { outer: ["overflow"] });
3913
- // outer: "overflow-hidden" inner: "p-4"
3956
+ splitBox("overflow-hidden p-4", { inner: ["overflow"] });
3957
+ // outer: "" inner: "overflow-hidden p-4"
3914
3958
 
3915
3959
  // Toolkit: csszyx owns the truth (box-role/category), your project owns the rule
3916
- classify("inset-ring-2"); // { role: 'inner', category: 'ring' }
3960
+ classify("inset-ring-2"); // { role: 'outer', category: 'ring' }
3917
3961
  has("p-2 overflow-y-auto", "overflow"); // true
3918
3962
  pick("m-4 text-sm", "text"); // "text-sm"
3919
3963
  omit("p-2 overflow-y-auto flex", "overflow"); // "p-2 flex"
3920
3964
 
3921
- // A scroller scrolls only when the outer frame clips (project-owned dependency rule)
3922
- const dep = has(outer, { overflow: "hidden" }) ? "overflow-y-auto h-full" : "";
3965
+ // A scroll frame: the clip and the height land outer on their own; the plumbing that lets a
3966
+ // child inherit the frame's height is the component's own (min-h-0 defeats flex's min-height:auto)
3967
+ // frame: `${outer} flex flex-col min-h-0 overflow-hidden`
3968
+ // content: `${inner} flex-1 min-h-0 overflow-y-auto`
3923
3969
 
3924
3970
  // sz-OBJECT routing: splitBoxSz partitions an sz OBJECT (not a className) into
3925
3971
  // { outer, inner } sz objects — keeps a szv-based component sz-native and routes
3926
3972
  // each key to the same side its class would (splitBoxSz(x) ≡ splitBox(compile(x))).
3927
3973
  splitBoxSz({ m: 4, px: 2 }); // { outer: { m: 4 }, inner: { px: 2 } }
3928
3974
  splitBoxSz({ gap: 2, hover: { px: 1 }, md: { m: 4 } }); // variants route by inner prop; split when they disagree
3929
- splitBoxSz({ grow: 2, self: "center" }, { outer: ["grow", "self"] }); // force flex-item utils to the frame
3930
- // classifySzKey(key) / hasSz / pickSz / omitSz the sz-object toolkit twins
3975
+ splitBoxSz({ grow: 2, self: "center" }, { inner: ["grow", "self"] }); // item utils (grow/order/self/col-span) are OUTER by default; this forces them back to the content
3976
+ // Placement lists can pin a whole literal variant key, preserving its contents.
3977
+ splitBoxSz({ hover: { p: 2, m: 4 } }, { outer: ["hover"] });
3978
+ // { outer: { hover: { p: 2, m: 4 } }, inner: {} }
3979
+ // Literal keys such as "[&:hover]" work too; inner wins if both lists name it.
3980
+ splitBoxSz({ overflow: "hidden", p: 4 }); // { outer: { overflow: 'hidden' }, inner: { p: 4 } }
3981
+ // classifySzKey(key, value?) / hasSz / pickSz / omitSz — the sz-object toolkit twins
3982
+ // (pass the value for a key whose side depends on it: classifySzKey('overflow', 'hidden') → outer)
3931
3983
 
3932
3984
  // stripSzProps: drop sz before forwarding ...rest to the DOM (guards uncompiled files
3933
3985
  // whose raw sz would leak as sz="[object Object]"; dev-warns once on a raw-object sz)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/mcp-server",
3
- "version": "0.15.3",
3
+ "version": "0.17.0",
4
4
  "description": "Model Context Protocol (MCP) server for csszyx — enables AI agents to understand and generate sz props",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,9 +28,9 @@
28
28
  "node": "^22.18.0 || >=24.11.0"
29
29
  },
30
30
  "dependencies": {
31
- "@csszyx/cli": "0.15.3",
32
- "@csszyx/compiler": "0.15.3",
33
- "@csszyx/unplugin": "0.15.3",
31
+ "@csszyx/cli": "0.17.0",
32
+ "@csszyx/compiler": "0.17.0",
33
+ "@csszyx/unplugin": "0.17.0",
34
34
  "@modelcontextprotocol/sdk": "^1.30.0",
35
35
  "zod": "^4.4.3"
36
36
  },