@csszyx/mcp-server 0.16.0 → 0.17.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.
Files changed (2) hide show
  1. package/llms-full.txt +55 -12
  2. package/package.json +6 -6
package/llms-full.txt CHANGED
@@ -250,6 +250,11 @@ canonical key or replacement shape. A truly unknown key is different: it warns
250
250
  but still emits a kebab-case candidate so an intentional Tailwind `@utility`
251
251
  can serve it.
252
252
 
253
+ Diagnostics retain the statically resolved objects inside conditional branches,
254
+ ternary spreads and sz arrays. Shared source properties are reported once, without
255
+ changing emitted classes. Unresolved spreads still have incomplete key/value
256
+ checking: a fallback warning does not mean their readable properties are clean.
257
+
253
258
  ## Type safety — unknown keys are TypeScript errors
254
259
 
255
260
  The `sz` prop type is **closed**: a key that is not a known sz prop or variant is a
@@ -688,6 +693,7 @@ Strategy for static analysis vs runtime generation.
688
693
  | **Variable reference** | ❌ Not applicable | ✅ **Build time** | `sz={myVar}` — pass variable directly when no override needed. Compiler resolves the binding to its object literal initializer (incl. `as const`, `satisfies`, explicit type annotation). |
689
694
  | **Object Spread** | ❌ Fails spread | ✅ **Static Analysis** | `sz={{ ...baseProps, key: val }}` — use spread only when overriding/adding; last key wins. Resolved at build time for local literals. Multiple/nested spreads supported. Imported vars fall back to `_sz()` — no crash. When runtime `sz` emits CSS variables beside one direct object-literal JSX prop spread, or one conditional with object-literal branches, generated variables merge into every branch's `style`; unresolved/multiple JSX spreads retain a collision diagnostic. |
690
695
  | **Array variable items** | ❌ Not applicable | ✅ **Build time** | `sz={[varA, varB]}` and `sz={[varA, cond && varB]}` — LATER WINS composition. All-static-object arrays deep-merge at build (later leaf wins per key path, sibling keys survive) into one className; arrays with strings/conditions/dynamic elements emit `_szcn(...)` — a compiler-injected helper (`_` = generated code, never hand-authored; the unmemoized twin of `szcn`) applying the same later-wins rule per property group at runtime. Finite ternary elements and finite conditional object properties compile to conditional class strings; only truly dynamic elements (e.g. a forwarded `szsc` slot) pass through `_szPart` (string passthrough / sz-object compile). |
696
+ | **Two `sz` attributes** | ❌ Not applicable | ✅ **Build time** | `<div sz={a} sz={b} />` is read as `sz={[a, b]}` — later wins per property, one className, an authored `className` first. Every shape folds: two arrays join their elements; a ternary or a runtime value becomes one element of the composition. JSX compilers would pass the duplicate through as a duplicate object key, where the last silently replaces the first. Reported as a nudge — write the array so the order is on the page. |
691
697
  | **Ternary variable branches** | ❌ Not applicable | ✅ **Build time** | `sz={cond ? varA : varB}` — both branches compiled to static strings when variables are local literals. A branch spelled `undefined`, `null`, `false`, or `{}` is the EMPTY style and compiles to no classes, so `sz={cond ? varA : undefined}` folds just like `: {}`. A chain — `a ? x : b ? y : z` — compiles too, up to 8 tests; the emitted expression keeps the same nesting, so each test is only reached when every test before it was falsy. Past 8 the attribute keeps the runtime path. |
692
698
  | **Guarded style (`&&`)** | ❌ Not applicable | ✅ **Build time** | `sz={cond && varA}` compiles to the ternary it already is, because a falsy left operand is the empty style. `sz={a \|\| varA}` does NOT compile: `\|\|` yields its LEFT operand when the test passes, and that value can be a style the fold would drop. |
693
699
  | **Chained variables** | ❌ Not applicable | ✅ **Build time** | `const b = { ...a, key: val }; <div sz={b} />` — compiler resolves the chain recursively. |
@@ -2906,9 +2912,9 @@ Controlling inline-size (logical equivalent of width). Added in Tailwind v4.2.
2906
2912
 
2907
2913
  Component-like utility for fixing an element's width to the current breakpoint.
2908
2914
 
2909
- | Concept | CSS Rule | Tailwind v4 Class | `sz` Prop (Object Syntax) | Note |
2910
- | :--------- | :---------------------------------------------- | :---------------- | :------------------------ | :------------------------------------------------------ |
2911
- | **Enable** | `width: 100%; max-width: 100% (at breakpoints)` | `container` | `{ container: true }` | **Top-level prop**. Better DX than `maxW: 'container'`. |
2915
+ | Concept | CSS Rule | Tailwind v4 Class | `sz` Prop (Object Syntax) | Note |
2916
+ | :--------- | :---------------------------------------------------------- | :---------------- | :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2917
+ | **Enable** | `width: 100%; max-width: <breakpoint> (at each breakpoint)` | `container` | `{ container: true }` | **Top-level prop**. `maxW` does not accept `container`: it resolves against the `--container-*` scale, where no `container` key exists, so `{ maxW: 'container' }` emits `max-w-container` and styles nothing. |
2912
2918
 
2913
2919
  ## Typography Plugin (Prose)
2914
2920
 
@@ -3905,6 +3911,27 @@ import { __szColorVar } from "csszyx/lite";
3905
3911
 
3906
3912
  ## Nested Element Routing — splitBox + class toolkit
3907
3913
 
3914
+ For className-only consumers, import `classify`, `has`, `pick`, `omit` and
3915
+ `splitBox` from `@csszyx/runtime/split`. The entry excludes sz-object adapters;
3916
+ ESM can tree-shake the main entry too, while CommonJS benefits from the narrower
3917
+ surface. The compiler dependency remains.
3918
+
3919
+ The supported vocabulary is atomic utilities. A multi-property custom
3920
+ `@utility card` is not classified: `pick` excludes it, `omit` retains it, and
3921
+ `splitBox` leaves it on the fallback node with a development warning unless
3922
+ explicitly placed. Use `splitBox('card p-4', { inner: ['card'] })` to place the
3923
+ whole class; no CSS declarations are split. Literal placement matches a whole
3924
+ base name, so `card` does not match `card-lg`. Use authored names when mangling.
3925
+ `{ outer: ['hidden'] }` matches every variant of `hidden`; naming `md:hidden`
3926
+ in a class placement list matches nothing and warns. Query helpers still
3927
+ require recognised selectors.
3928
+
3929
+ `scope` is the category for `group` and `peer`, including `group/item`. Both
3930
+ route outer: `group` supplies an ancestor and `peer` keeps its sibling position.
3931
+ The expanded vocabulary also recognises `placeholder-*` as inner and
3932
+ `start-*`/`end-*` as outer. These classes previously used the fallback, so
3933
+ review old routing assumptions and category-query expectations when upgrading.
3934
+
3908
3935
  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).
3909
3936
 
3910
3937
  ```tsx
@@ -3918,31 +3945,47 @@ import {
3918
3945
  stripSzProps,
3919
3946
  } from "@csszyx/runtime";
3920
3947
 
3921
- // Partition: outer = border-outward (margin/position/border/ring/sizing/bg/shadow/transform/visibility),
3922
- // inner = border-inward (padding/overflow/display/flex/grid/gap/text/interaction)
3948
+ // Partition: outer = border-outward (margin/position/border/ring/sizing/bg/shadow/transform/
3949
+ // visibility/overflow-hidden+clip/cursor/select/pointer-events/scroll-m/snap-start/align),
3950
+ // inner = border-inward (padding/overflow-auto+scroll/display/flex/grid/gap/text/divide/
3951
+ // perspective/transform-3d/resize/appearance)
3952
+ // Both: transition/duration/ease/delay are declared on BOTH nodes (a transition is inert until a
3953
+ // property changes, and the state that changes it can sit on either side).
3923
3954
  const { outer, inner } = splitBox("m-4 px-2 md:flex");
3924
3955
  // outer: "m-4" inner: "px-2 md:flex"
3925
3956
 
3957
+ // overflow routes by VALUE: hidden/clip clip the frame, auto/scroll scroll the content
3958
+ splitBox("overflow-hidden overflow-y-auto p-4");
3959
+ // outer: "overflow-hidden" inner: "overflow-y-auto p-4"
3960
+
3926
3961
  // Override any default per call (BoxSelector = box-role | category | class-prefix | { category: value })
3927
- splitBox("overflow-hidden p-4", { outer: ["overflow"] });
3928
- // outer: "overflow-hidden" inner: "p-4"
3962
+ splitBox("overflow-hidden p-4", { inner: ["overflow"] });
3963
+ // outer: "" inner: "overflow-hidden p-4"
3929
3964
 
3930
3965
  // Toolkit: csszyx owns the truth (box-role/category), your project owns the rule
3931
- classify("inset-ring-2"); // { role: 'inner', category: 'ring' }
3966
+ classify("inset-ring-2"); // { role: 'outer', category: 'ring' }
3932
3967
  has("p-2 overflow-y-auto", "overflow"); // true
3933
3968
  pick("m-4 text-sm", "text"); // "text-sm"
3934
3969
  omit("p-2 overflow-y-auto flex", "overflow"); // "p-2 flex"
3935
3970
 
3936
- // A scroller scrolls only when the outer frame clips (project-owned dependency rule)
3937
- const dep = has(outer, { overflow: "hidden" }) ? "overflow-y-auto h-full" : "";
3971
+ // A scroll frame: the clip and the height land outer on their own; the plumbing that lets a
3972
+ // child inherit the frame's height is the component's own (min-h-0 defeats flex's min-height:auto)
3973
+ // frame: `${outer} flex flex-col min-h-0 overflow-hidden`
3974
+ // content: `${inner} flex-1 min-h-0 overflow-y-auto`
3938
3975
 
3939
3976
  // sz-OBJECT routing: splitBoxSz partitions an sz OBJECT (not a className) into
3940
3977
  // { outer, inner } sz objects — keeps a szv-based component sz-native and routes
3941
3978
  // each key to the same side its class would (splitBoxSz(x) ≡ splitBox(compile(x))).
3942
3979
  splitBoxSz({ m: 4, px: 2 }); // { outer: { m: 4 }, inner: { px: 2 } }
3943
3980
  splitBoxSz({ gap: 2, hover: { px: 1 }, md: { m: 4 } }); // variants route by inner prop; split when they disagree
3944
- splitBoxSz({ grow: 2, self: "center" }, { outer: ["grow", "self"] }); // force flex-item utils to the frame
3945
- // classifySzKey(key) / hasSz / pickSz / omitSz the sz-object toolkit twins
3981
+ 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
3982
+ // Placement lists can pin a whole literal variant key, preserving its contents.
3983
+ splitBoxSz({ hover: { p: 2, m: 4 } }, { outer: ["hover"] });
3984
+ // { outer: { hover: { p: 2, m: 4 } }, inner: {} }
3985
+ // Literal keys such as "[&:hover]" work too; inner wins if both lists name it.
3986
+ splitBoxSz({ overflow: "hidden", p: 4 }); // { outer: { overflow: 'hidden' }, inner: { p: 4 } }
3987
+ // classifySzKey(key, value?) / hasSz / pickSz / omitSz — the sz-object toolkit twins
3988
+ // (pass the value for a key whose side depends on it: classifySzKey('overflow', 'hidden') → outer)
3946
3989
 
3947
3990
  // stripSzProps: drop sz before forwarding ...rest to the DOM (guards uncompiled files
3948
3991
  // 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.16.0",
3
+ "version": "0.17.1",
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,15 +28,15 @@
28
28
  "node": "^22.18.0 || >=24.11.0"
29
29
  },
30
30
  "dependencies": {
31
- "@csszyx/cli": "0.16.0",
32
- "@csszyx/compiler": "0.16.0",
33
- "@csszyx/unplugin": "0.16.0",
31
+ "@csszyx/cli": "0.17.1",
32
+ "@csszyx/compiler": "0.17.1",
33
+ "@csszyx/unplugin": "0.17.1",
34
34
  "@modelcontextprotocol/sdk": "^1.30.0",
35
- "zod": "^4.4.3"
35
+ "zod": "^4.5.4"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^22.20.1",
39
- "tsx": "^4.23.12",
39
+ "tsx": "^4.23.13",
40
40
  "typescript": "^6.0.3",
41
41
  "unbuild": "^3.6.1",
42
42
  "vitest": "^4.1.11"