cssints 0.0.0-stage → 0.2.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 (148) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +188 -2
  3. package/dist/author-types-C1AhsnrT.d.mts +80 -0
  4. package/dist/check.d.mts +22 -0
  5. package/dist/check.mjs +37 -0
  6. package/dist/color-BYIxVLlS.mjs +29 -0
  7. package/dist/color-C8OzjAeg.mjs +2 -0
  8. package/dist/contrast-DhK69Xak.mjs +83 -0
  9. package/dist/derived.d.mts +14 -0
  10. package/dist/derived.mjs +391 -0
  11. package/dist/errors-D4ZbcwRo.d.mts +32 -0
  12. package/dist/frame-BoBKjgBB.mjs +92 -0
  13. package/dist/frame.d.mts +72 -0
  14. package/dist/frame.mjs +2 -0
  15. package/dist/group-common-9zpBxfUF.d.mts +1 -0
  16. package/dist/group-types-9ttphdku.d.mts +55 -0
  17. package/dist/groups/compositing-2.d.mts +20 -0
  18. package/dist/groups/css-align-3.d.mts +29 -0
  19. package/dist/groups/css-anchor-position-1.d.mts +49 -0
  20. package/dist/groups/css-anchor-position-2.d.mts +50 -0
  21. package/dist/groups/css-animations-1.d.mts +28 -0
  22. package/dist/groups/css-animations-2.d.mts +29 -0
  23. package/dist/groups/css-backgrounds-3.d.mts +27 -0
  24. package/dist/groups/css-backgrounds-4.d.mts +29 -0
  25. package/dist/groups/css-borders-4.d.mts +95 -0
  26. package/dist/groups/css-box-4.d.mts +38 -0
  27. package/dist/groups/css-break-4.d.mts +23 -0
  28. package/dist/groups/css-cascade-5.d.mts +18 -0
  29. package/dist/groups/css-cascade-6.d.mts +18 -0
  30. package/dist/groups/css-color-4.d.mts +29 -0
  31. package/dist/groups/css-color-5.d.mts +32 -0
  32. package/dist/groups/css-color-6.d.mts +32 -0
  33. package/dist/groups/css-color-adjust-1.d.mts +20 -0
  34. package/dist/groups/css-color-hdr-1.d.mts +19 -0
  35. package/dist/groups/css-conditional-3.d.mts +17 -0
  36. package/dist/groups/css-conditional-4.d.mts +17 -0
  37. package/dist/groups/css-conditional-5.d.mts +22 -0
  38. package/dist/groups/css-contain-2.d.mts +19 -0
  39. package/dist/groups/css-content-3.d.mts +23 -0
  40. package/dist/groups/css-counter-styles-3.d.mts +16 -0
  41. package/dist/groups/css-display-4.d.mts +22 -0
  42. package/dist/groups/css-easing-2.d.mts +18 -0
  43. package/dist/groups/css-env-1.d.mts +16 -0
  44. package/dist/groups/css-flexbox-1.d.mts +24 -0
  45. package/dist/groups/css-fonts-4.d.mts +46 -0
  46. package/dist/groups/css-fonts-5.d.mts +44 -0
  47. package/dist/groups/css-forms-1.d.mts +19 -0
  48. package/dist/groups/css-gaps-1.d.mts +21 -0
  49. package/dist/groups/css-gcpm-3.d.mts +20 -0
  50. package/dist/groups/css-gcpm-4.d.mts +20 -0
  51. package/dist/groups/css-grid-2.d.mts +34 -0
  52. package/dist/groups/css-grid-3.d.mts +34 -0
  53. package/dist/groups/css-images-3.d.mts +25 -0
  54. package/dist/groups/css-images-4.d.mts +32 -0
  55. package/dist/groups/css-images-5.d.mts +33 -0
  56. package/dist/groups/css-inline-3.d.mts +28 -0
  57. package/dist/groups/css-lists-3.d.mts +26 -0
  58. package/dist/groups/css-logical-1.d.mts +35 -0
  59. package/dist/groups/css-masking-1.d.mts +37 -0
  60. package/dist/groups/css-multicol-2.d.mts +24 -0
  61. package/dist/groups/css-overflow-3.d.mts +28 -0
  62. package/dist/groups/css-overflow-4.d.mts +29 -0
  63. package/dist/groups/css-overflow-5.d.mts +31 -0
  64. package/dist/groups/css-overscroll-1.d.mts +22 -0
  65. package/dist/groups/css-page-3.d.mts +18 -0
  66. package/dist/groups/css-page-floats-3.d.mts +19 -0
  67. package/dist/groups/css-position-3.d.mts +29 -0
  68. package/dist/groups/css-position-4.d.mts +30 -0
  69. package/dist/groups/css-rhythm-1.d.mts +18 -0
  70. package/dist/groups/css-round-display-1.d.mts +16 -0
  71. package/dist/groups/css-ruby-1.d.mts +21 -0
  72. package/dist/groups/css-scroll-anchoring-1.d.mts +18 -0
  73. package/dist/groups/css-scroll-snap-1.d.mts +42 -0
  74. package/dist/groups/css-scroll-snap-2.d.mts +43 -0
  75. package/dist/groups/css-scrollbars-1.d.mts +19 -0
  76. package/dist/groups/css-shapes-1.d.mts +27 -0
  77. package/dist/groups/css-shapes-2.d.mts +27 -0
  78. package/dist/groups/css-size-adjust-1.d.mts +18 -0
  79. package/dist/groups/css-sizing-3.d.mts +34 -0
  80. package/dist/groups/css-sizing-4.d.mts +33 -0
  81. package/dist/groups/css-speech-1.d.mts +18 -0
  82. package/dist/groups/css-tables-3.d.mts +22 -0
  83. package/dist/groups/css-text-3.d.mts +36 -0
  84. package/dist/groups/css-text-4.d.mts +40 -0
  85. package/dist/groups/css-text-decor-3.d.mts +30 -0
  86. package/dist/groups/css-text-decor-4.d.mts +31 -0
  87. package/dist/groups/css-transforms-1.d.mts +31 -0
  88. package/dist/groups/css-transforms-2.d.mts +48 -0
  89. package/dist/groups/css-transitions-1.d.mts +22 -0
  90. package/dist/groups/css-transitions-2.d.mts +23 -0
  91. package/dist/groups/css-ui-4.d.mts +35 -0
  92. package/dist/groups/css-values-4.d.mts +38 -0
  93. package/dist/groups/css-values-5.d.mts +43 -0
  94. package/dist/groups/css-variables-2.d.mts +6 -0
  95. package/dist/groups/css-view-transitions-2.d.mts +20 -0
  96. package/dist/groups/css-viewport.d.mts +18 -0
  97. package/dist/groups/css-will-change-1.d.mts +18 -0
  98. package/dist/groups/css-writing-modes-4.d.mts +22 -0
  99. package/dist/groups/css2.d.mts +19 -0
  100. package/dist/groups/fill-stroke-3.d.mts +27 -0
  101. package/dist/groups/filter-effects-1.d.mts +32 -0
  102. package/dist/groups/filter-effects-2.d.mts +33 -0
  103. package/dist/groups/limited-availability.d.mts +2 -0
  104. package/dist/groups/mediaqueries-4.d.mts +16 -0
  105. package/dist/groups/mediaqueries-5.d.mts +16 -0
  106. package/dist/groups/motion-1.d.mts +24 -0
  107. package/dist/groups/newly-available.d.mts +631 -0
  108. package/dist/groups/not-discouraged.d.mts +727 -0
  109. package/dist/groups/scroll-animations-1.d.mts +30 -0
  110. package/dist/groups/selectors-4.d.mts +54 -0
  111. package/dist/groups/selectors-5.d.mts +54 -0
  112. package/dist/groups/widely-available.d.mts +616 -0
  113. package/dist/index.d.mts +48 -0
  114. package/dist/index.mjs +1269 -0
  115. package/dist/instrument-gCazujmb.mjs +1624 -0
  116. package/dist/lowered-D2KusPLp.mjs +28 -0
  117. package/dist/node-OJ_w_Usj.d.mts +233 -0
  118. package/dist/parent-vars.d.mts +13 -0
  119. package/dist/parent-vars.mjs +65 -0
  120. package/dist/plugin-types.d.mts +377 -0
  121. package/dist/plugin.d.mts +3 -0
  122. package/dist/plugin.mjs +30 -0
  123. package/dist/registry-CTumHB8p.mjs +73 -0
  124. package/dist/runtime-Dt4Tm0Q7.d.mts +19 -0
  125. package/dist/runtime.d.mts +18 -0
  126. package/dist/runtime.mjs +25 -0
  127. package/dist/scope-ZVhUxQH1.d.mts +2101 -0
  128. package/dist/sheet-BKsMTa0c.mjs +757 -0
  129. package/dist/surface.d.mts +228 -0
  130. package/dist/surface.mjs +101 -0
  131. package/dist/theme-BsP2E4LB.mjs +929 -0
  132. package/dist/theme-types-Bqv0Ggz_.d.mts +1808 -0
  133. package/dist/trace-otlp-CbKFDsn9.mjs +14 -0
  134. package/dist/tui-types.d.mts +181 -0
  135. package/dist/tui.d.mts +23 -0
  136. package/dist/tui.mjs +427 -0
  137. package/dist/types.d.mts +2 -0
  138. package/dist/vite.d.mts +134 -0
  139. package/dist/vite.mjs +977 -0
  140. package/docs/API.md +1193 -0
  141. package/package.json +85 -4
  142. package/skills/cssints/SKILL.md +203 -0
  143. package/skills/cssints/references/errors.md +86 -0
  144. package/skills/cssints/references/plugins.md +91 -0
  145. package/skills/cssints/references/tokens.md +91 -0
  146. package/skills/cssints-plugin/SKILL.md +177 -0
  147. package/skills/cssints-plugin/references/table.md +124 -0
  148. package/skills/cssints-plugin/references/testing.md +122 -0
@@ -0,0 +1,228 @@
1
+ import { t as AliasesOf } from "./scope-ZVhUxQH1.mjs";
2
+ //#region src/surface.d.ts
3
+ /**
4
+ * `surface().color(t.color.canvas).lighten(0.06).ink()`: a background that follows from the surface around it, however
5
+ * many plain wrappers sit between. `color(<color>)` is an absolute base (default: the parent surface); `lighten(step)`,
6
+ * `darken(step)` and `contrast(step)` (away from the parent: a light parent is darkened, a dark one lightened) move its
7
+ * OKLCH lightness by `step` in [0, 1], and only one of them goes in a chain. `ink()` is black or white text by the
8
+ * lightness of the surface. These are tonal steps, not a contrast guarantee: for a ratio, check declared tokens with
9
+ * `css.check.contrast`. It stands for `background-color`, so mixing it with `bg()`, `background` or `backgroundColor` in
10
+ * one `cn()` is a build error.
11
+ */
12
+ export declare const surfaceScope: import("cssints/plugin").Scope<"surface", {
13
+ readonly frame: import("cssints/plugin").Scope<"frame", {
14
+ readonly core: {
15
+ readonly css: string;
16
+ readonly atProperty: string;
17
+ readonly requires: ["css.at-rules.property", "css.types.max"];
18
+ };
19
+ readonly fallback: {
20
+ readonly polyfills: ["css.at-rules.container.style_queries_for_custom_properties"];
21
+ readonly parentVars: [{
22
+ readonly marker: "&";
23
+ readonly read: "--_i";
24
+ readonly write: "--_u";
25
+ readonly watch: "--_t";
26
+ }];
27
+ readonly css: "\n:root[data-cssints-poly] & {\n --_u: calc(var(--_r) + var(--_m));\n --_i: max(max(var(--_u) - var(--_m), 0px) - var(--_p) - var(--_b), 0px);\n --_t: var(--_i);\n border-radius: max(var(--_u) - var(--_m), 0px);\n transition: --_t 1ms;\n}";
28
+ };
29
+ readonly noBox: {
30
+ readonly props: [RegExp, RegExp];
31
+ readonly message: "frame() sets padding, margin, border-radius and the border: use its methods";
32
+ };
33
+ readonly frame: {
34
+ readonly uses: readonly ["core", "fallback", "noBox"];
35
+ readonly chain: {
36
+ readonly radius: {
37
+ readonly args: "<length [0,∞]>";
38
+ readonly emit: (v: string) => [string, string][];
39
+ };
40
+ readonly padding: {
41
+ readonly args: "<length [0,∞]>";
42
+ readonly spacing: true;
43
+ readonly emit: (v: string) => [string, string][];
44
+ };
45
+ readonly border: {
46
+ readonly args: "<length [0,∞]>";
47
+ readonly emit: (v: string) => [string, string][];
48
+ };
49
+ readonly margin: {
50
+ readonly args: "<length>";
51
+ readonly spacing: true;
52
+ readonly emit: (v: string) => [string, string][];
53
+ };
54
+ };
55
+ };
56
+ }>;
57
+ readonly core: {
58
+ readonly css: string;
59
+ readonly atProperty: string;
60
+ readonly requires: ["css.at-rules.property", {
61
+ readonly key: "css.types.color.oklch.relative_syntax";
62
+ readonly exact: true;
63
+ }];
64
+ };
65
+ readonly fallback: {
66
+ readonly polyfills: ["css.at-rules.container.style_queries_for_custom_properties"];
67
+ readonly parentVars: [{
68
+ readonly marker: "&";
69
+ readonly read: "--_v";
70
+ readonly write: "--_u";
71
+ readonly watch: "--_t";
72
+ }];
73
+ readonly css: string;
74
+ };
75
+ readonly noBackground: {
76
+ readonly props: ["background", "background-color"];
77
+ readonly message: "surface() sets the background colour: use its methods";
78
+ };
79
+ readonly surface: {
80
+ readonly uses: readonly ["core", "fallback", "noBackground"];
81
+ readonly chain: {
82
+ readonly color: {
83
+ readonly args: "<color>";
84
+ readonly emit: (v: string) => [string, string][];
85
+ };
86
+ readonly lighten: {
87
+ readonly args: "<number [0,1]>";
88
+ readonly excludes: readonly ["darken", "contrast"];
89
+ readonly emit: (v: string) => [string, string][];
90
+ };
91
+ readonly darken: {
92
+ readonly args: "<number [0,1]>";
93
+ readonly excludes: readonly ["lighten", "contrast"];
94
+ readonly emit: (v: string) => [string, string][];
95
+ };
96
+ readonly contrast: {
97
+ readonly args: "<number [0,1]>";
98
+ readonly excludes: readonly ["lighten", "darken"];
99
+ readonly emit: (v: string) => [string, string][];
100
+ };
101
+ readonly ink: {
102
+ readonly args: "";
103
+ readonly emit: () => [string, string][];
104
+ };
105
+ };
106
+ };
107
+ }>;
108
+ export declare const surface: () => import("cssints/plugin").Chain<"surface", {
109
+ readonly color: {
110
+ readonly args: "<color>";
111
+ readonly emit: (v: string) => [string, string][];
112
+ };
113
+ readonly lighten: {
114
+ readonly args: "<number [0,1]>";
115
+ readonly excludes: readonly ["darken", "contrast"];
116
+ readonly emit: (v: string) => [string, string][];
117
+ };
118
+ readonly darken: {
119
+ readonly args: "<number [0,1]>";
120
+ readonly excludes: readonly ["lighten", "contrast"];
121
+ readonly emit: (v: string) => [string, string][];
122
+ };
123
+ readonly contrast: {
124
+ readonly args: "<number [0,1]>";
125
+ readonly excludes: readonly ["lighten", "darken"];
126
+ readonly emit: (v: string) => [string, string][];
127
+ };
128
+ readonly ink: {
129
+ readonly args: "";
130
+ readonly emit: () => [string, string][];
131
+ };
132
+ }, AliasesOf<{
133
+ readonly frame: import("cssints/plugin").Scope<"frame", {
134
+ readonly core: {
135
+ readonly css: string;
136
+ readonly atProperty: string;
137
+ readonly requires: ["css.at-rules.property", "css.types.max"];
138
+ };
139
+ readonly fallback: {
140
+ readonly polyfills: ["css.at-rules.container.style_queries_for_custom_properties"];
141
+ readonly parentVars: [{
142
+ readonly marker: "&";
143
+ readonly read: "--_i";
144
+ readonly write: "--_u";
145
+ readonly watch: "--_t";
146
+ }];
147
+ readonly css: "\n:root[data-cssints-poly] & {\n --_u: calc(var(--_r) + var(--_m));\n --_i: max(max(var(--_u) - var(--_m), 0px) - var(--_p) - var(--_b), 0px);\n --_t: var(--_i);\n border-radius: max(var(--_u) - var(--_m), 0px);\n transition: --_t 1ms;\n}";
148
+ };
149
+ readonly noBox: {
150
+ readonly props: [RegExp, RegExp];
151
+ readonly message: "frame() sets padding, margin, border-radius and the border: use its methods";
152
+ };
153
+ readonly frame: {
154
+ readonly uses: readonly ["core", "fallback", "noBox"];
155
+ readonly chain: {
156
+ readonly radius: {
157
+ readonly args: "<length [0,∞]>";
158
+ readonly emit: (v: string) => [string, string][];
159
+ };
160
+ readonly padding: {
161
+ readonly args: "<length [0,∞]>";
162
+ readonly spacing: true;
163
+ readonly emit: (v: string) => [string, string][];
164
+ };
165
+ readonly border: {
166
+ readonly args: "<length [0,∞]>";
167
+ readonly emit: (v: string) => [string, string][];
168
+ };
169
+ readonly margin: {
170
+ readonly args: "<length>";
171
+ readonly spacing: true;
172
+ readonly emit: (v: string) => [string, string][];
173
+ };
174
+ };
175
+ };
176
+ }>;
177
+ readonly core: {
178
+ readonly css: string;
179
+ readonly atProperty: string;
180
+ readonly requires: ["css.at-rules.property", {
181
+ readonly key: "css.types.color.oklch.relative_syntax";
182
+ readonly exact: true;
183
+ }];
184
+ };
185
+ readonly fallback: {
186
+ readonly polyfills: ["css.at-rules.container.style_queries_for_custom_properties"];
187
+ readonly parentVars: [{
188
+ readonly marker: "&";
189
+ readonly read: "--_v";
190
+ readonly write: "--_u";
191
+ readonly watch: "--_t";
192
+ }];
193
+ readonly css: string;
194
+ };
195
+ readonly noBackground: {
196
+ readonly props: ["background", "background-color"];
197
+ readonly message: "surface() sets the background colour: use its methods";
198
+ };
199
+ readonly surface: {
200
+ readonly uses: readonly ["core", "fallback", "noBackground"];
201
+ readonly chain: {
202
+ readonly color: {
203
+ readonly args: "<color>";
204
+ readonly emit: (v: string) => [string, string][];
205
+ };
206
+ readonly lighten: {
207
+ readonly args: "<number [0,1]>";
208
+ readonly excludes: readonly ["darken", "contrast"];
209
+ readonly emit: (v: string) => [string, string][];
210
+ };
211
+ readonly darken: {
212
+ readonly args: "<number [0,1]>";
213
+ readonly excludes: readonly ["lighten", "contrast"];
214
+ readonly emit: (v: string) => [string, string][];
215
+ };
216
+ readonly contrast: {
217
+ readonly args: "<number [0,1]>";
218
+ readonly excludes: readonly ["lighten", "darken"];
219
+ readonly emit: (v: string) => [string, string][];
220
+ };
221
+ readonly ink: {
222
+ readonly args: "";
223
+ readonly emit: () => [string, string][];
224
+ };
225
+ };
226
+ };
227
+ }>>;
228
+ //#endregion
@@ -0,0 +1,101 @@
1
+ import { n as frameScope } from "./frame-BoBKjgBB.mjs";
2
+ import { scope } from "cssints/plugin";
3
+ //#region src/surface.ts
4
+ const registered = (names, inherits) => names.map((n) => `@property --_${n} { syntax: "<color>"; inherits: ${inherits}; initial-value: canvas; }`).join("\n");
5
+ const shift = (parent) => `oklch(from var(--_k, var(${parent})) calc(l + var(--_d)) c h)`;
6
+ const css = `
7
+ & {
8
+ --_k: initial;
9
+ --_d: 0;
10
+ background-color: var(--_s);
11
+ }
12
+ @container (style(--_p: e)) or (not style(--_p)) {
13
+ & { --_p: o; --_s: ${shift("--_e")}; --_o: var(--_s); }
14
+ }
15
+ @container style(--_p: o) {
16
+ & { --_p: e; --_s: ${shift("--_o")}; --_e: var(--_s); }
17
+ }`;
18
+ const fallback = `
19
+ :root[data-cssints-poly] & {
20
+ --_s: ${shift("--_u")};
21
+ --_v: var(--_s);
22
+ --_t: var(--_v);
23
+ background-color: var(--_s);
24
+ transition: --_t 1ms;
25
+ }
26
+ :root[data-cssints-poly] &&(frame.core) { transition: --_t 1ms, --frame-t 1ms; }`;
27
+ const pivot = "(0.5636 - l) * 1e6";
28
+ const step = "<number [0,1]>";
29
+ /**
30
+ * `surface().color(t.color.canvas).lighten(0.06).ink()`: a background that follows from the surface around it, however
31
+ * many plain wrappers sit between. `color(<color>)` is an absolute base (default: the parent surface); `lighten(step)`,
32
+ * `darken(step)` and `contrast(step)` (away from the parent: a light parent is darkened, a dark one lightened) move its
33
+ * OKLCH lightness by `step` in [0, 1], and only one of them goes in a chain. `ink()` is black or white text by the
34
+ * lightness of the surface. These are tonal steps, not a contrast guarantee: for a ratio, check declared tokens with
35
+ * `css.check.contrast`. It stands for `background-color`, so mixing it with `bg()`, `background` or `backgroundColor` in
36
+ * one `cn()` is a build error.
37
+ */
38
+ const surfaceScope = scope("surface", {
39
+ frame: frameScope,
40
+ core: {
41
+ css,
42
+ atProperty: [registered(["e", "o"], true), registered([
43
+ "u",
44
+ "v",
45
+ "t"
46
+ ], false)].join("\n"),
47
+ requires: ["css.at-rules.property", {
48
+ key: "css.types.color.oklch.relative_syntax",
49
+ exact: true
50
+ }]
51
+ },
52
+ fallback: {
53
+ polyfills: ["css.at-rules.container.style_queries_for_custom_properties"],
54
+ parentVars: [{
55
+ marker: "&",
56
+ read: "--_v",
57
+ write: "--_u",
58
+ watch: "--_t"
59
+ }],
60
+ css: fallback
61
+ },
62
+ noBackground: {
63
+ props: ["background", "background-color"],
64
+ message: "surface() sets the background colour: use its methods"
65
+ },
66
+ surface: {
67
+ uses: [
68
+ "core",
69
+ "fallback",
70
+ "noBackground"
71
+ ],
72
+ chain: {
73
+ color: {
74
+ args: "<color>",
75
+ emit: (v) => [["--_k", v]]
76
+ },
77
+ lighten: {
78
+ args: step,
79
+ excludes: ["darken", "contrast"],
80
+ emit: (v) => [["--_d", v]]
81
+ },
82
+ darken: {
83
+ args: step,
84
+ excludes: ["lighten", "contrast"],
85
+ emit: (v) => [["--_d", `calc(${v} * -1)`]]
86
+ },
87
+ contrast: {
88
+ args: step,
89
+ excludes: ["lighten", "darken"],
90
+ emit: (v) => [["--_d", `calc(${v} * clamp(-1, ${pivot}, 1))`]]
91
+ },
92
+ ink: {
93
+ args: "",
94
+ emit: () => [["color", `oklch(from var(--_s) clamp(0, ${pivot}, 1) 0 0)`]]
95
+ }
96
+ }
97
+ }
98
+ });
99
+ const { surface } = surfaceScope.export();
100
+ //#endregion
101
+ export { surface, surfaceScope };