cssints 0.6.0 → 0.7.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/dist/{author-types-C1AhsnrT.d.mts → author-types-D9IjEXwn.d.mts} +0 -2
- package/dist/check.d.mts +1 -3
- package/dist/check.mjs +4 -5
- package/dist/clay-types.d.mts +87 -3
- package/dist/clay.d.mts +2 -3
- package/dist/clay.mjs +152 -12
- package/dist/{color-BYIxVLlS.mjs → color-BB8ipynT.mjs} +1 -2
- package/dist/color-DNL0XuEi.mjs +1 -0
- package/dist/{contrast-DLi4pp25.mjs → contrast-Dw6gXoO3.mjs} +4 -5
- package/dist/derived.d.mts +0 -2
- package/dist/derived.mjs +1 -2
- package/dist/{devtools-link-D2YxsJKZ.mjs → devtools-link-DN91p7g5.mjs} +1 -2
- package/dist/devtools-link.d.mts +1 -3
- package/dist/devtools-link.mjs +1 -2
- package/dist/{errors-D4ZbcwRo.d.mts → errors-jNEiB3ye.d.mts} +0 -2
- package/dist/{frame-BoBKjgBB.mjs → frame-DqwCA4OH.mjs} +1 -2
- package/dist/frame.d.mts +1 -3
- package/dist/frame.mjs +1 -2
- package/dist/group-common-CTUs5yym.d.mts +1 -0
- package/dist/{group-types-Dn9CIR8J.d.mts → group-types-BBaZ8dwy.d.mts} +1 -3
- package/dist/groups/baseline-2015/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2015.d.mts +3 -5
- package/dist/groups/baseline-2016/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2016.d.mts +3 -5
- package/dist/groups/baseline-2017/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2017.d.mts +3 -5
- package/dist/groups/baseline-2018/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2018.d.mts +3 -5
- package/dist/groups/baseline-2019/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2019.d.mts +3 -5
- package/dist/groups/baseline-2020/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2020.d.mts +3 -5
- package/dist/groups/baseline-2021/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2021.d.mts +3 -5
- package/dist/groups/baseline-2022/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2022.d.mts +3 -5
- package/dist/groups/baseline-2023/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2023.d.mts +3 -5
- package/dist/groups/baseline-2024/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2024.d.mts +3 -5
- package/dist/groups/baseline-2025/with-downstream.d.mts +3 -5
- package/dist/groups/baseline-2025.d.mts +3 -5
- package/dist/groups/baseline-2026/with-downstream.d.mts +1 -1
- package/dist/groups/baseline-2026.d.mts +1 -1
- package/dist/groups/compositing-2.d.mts +3 -5
- package/dist/groups/css-align-3.d.mts +3 -5
- package/dist/groups/css-anchor-position-1.d.mts +3 -5
- package/dist/groups/css-anchor-position-2.d.mts +3 -5
- package/dist/groups/css-animations-1.d.mts +3 -5
- package/dist/groups/css-animations-2.d.mts +3 -5
- package/dist/groups/css-backgrounds-3.d.mts +3 -5
- package/dist/groups/css-backgrounds-4.d.mts +3 -5
- package/dist/groups/css-borders-4.d.mts +3 -5
- package/dist/groups/css-box-4.d.mts +3 -5
- package/dist/groups/css-break-4.d.mts +3 -5
- package/dist/groups/css-cascade-5.d.mts +3 -5
- package/dist/groups/css-cascade-6.d.mts +3 -5
- package/dist/groups/css-color-4.d.mts +3 -5
- package/dist/groups/css-color-5.d.mts +3 -5
- package/dist/groups/css-color-6.d.mts +3 -5
- package/dist/groups/css-color-adjust-1.d.mts +3 -5
- package/dist/groups/css-color-hdr-1.d.mts +3 -5
- package/dist/groups/css-conditional-3.d.mts +3 -5
- package/dist/groups/css-conditional-4.d.mts +3 -5
- package/dist/groups/css-conditional-5.d.mts +3 -5
- package/dist/groups/css-contain-2.d.mts +3 -5
- package/dist/groups/css-content-3.d.mts +3 -5
- package/dist/groups/css-counter-styles-3.d.mts +3 -5
- package/dist/groups/css-display-4.d.mts +3 -5
- package/dist/groups/css-easing-2.d.mts +3 -5
- package/dist/groups/css-env-1.d.mts +3 -5
- package/dist/groups/css-flexbox-1.d.mts +3 -5
- package/dist/groups/css-fonts-4.d.mts +3 -5
- package/dist/groups/css-fonts-5.d.mts +3 -5
- package/dist/groups/css-forms-1.d.mts +3 -5
- package/dist/groups/css-gaps-1.d.mts +3 -5
- package/dist/groups/css-gcpm-3.d.mts +3 -5
- package/dist/groups/css-gcpm-4.d.mts +3 -5
- package/dist/groups/css-grid-2.d.mts +3 -5
- package/dist/groups/css-grid-3.d.mts +3 -5
- package/dist/groups/css-images-3.d.mts +3 -5
- package/dist/groups/css-images-4.d.mts +3 -5
- package/dist/groups/css-images-5.d.mts +3 -5
- package/dist/groups/css-inline-3.d.mts +3 -5
- package/dist/groups/css-lists-3.d.mts +3 -5
- package/dist/groups/css-logical-1.d.mts +3 -5
- package/dist/groups/css-masking-1.d.mts +3 -5
- package/dist/groups/css-multicol-2.d.mts +3 -5
- package/dist/groups/css-overflow-3.d.mts +3 -5
- package/dist/groups/css-overflow-4.d.mts +3 -5
- package/dist/groups/css-overflow-5.d.mts +3 -5
- package/dist/groups/css-overscroll-1.d.mts +3 -5
- package/dist/groups/css-page-3.d.mts +3 -5
- package/dist/groups/css-page-floats-3.d.mts +3 -5
- package/dist/groups/css-position-3.d.mts +3 -5
- package/dist/groups/css-position-4.d.mts +3 -5
- package/dist/groups/css-rhythm-1.d.mts +3 -5
- package/dist/groups/css-round-display-1.d.mts +3 -5
- package/dist/groups/css-ruby-1.d.mts +3 -5
- package/dist/groups/css-scroll-anchoring-1.d.mts +3 -5
- package/dist/groups/css-scroll-snap-1.d.mts +3 -5
- package/dist/groups/css-scroll-snap-2.d.mts +3 -5
- package/dist/groups/css-scrollbars-1.d.mts +3 -5
- package/dist/groups/css-shapes-1.d.mts +3 -5
- package/dist/groups/css-shapes-2.d.mts +3 -5
- package/dist/groups/css-size-adjust-1.d.mts +3 -5
- package/dist/groups/css-sizing-3.d.mts +3 -5
- package/dist/groups/css-sizing-4.d.mts +3 -5
- package/dist/groups/css-speech-1.d.mts +3 -5
- package/dist/groups/css-tables-3.d.mts +3 -5
- package/dist/groups/css-text-3.d.mts +3 -5
- package/dist/groups/css-text-4.d.mts +3 -5
- package/dist/groups/css-text-decor-3.d.mts +3 -5
- package/dist/groups/css-text-decor-4.d.mts +3 -5
- package/dist/groups/css-transforms-1.d.mts +3 -5
- package/dist/groups/css-transforms-2.d.mts +3 -5
- package/dist/groups/css-transitions-1.d.mts +3 -5
- package/dist/groups/css-transitions-2.d.mts +3 -5
- package/dist/groups/css-ui-4.d.mts +3 -5
- package/dist/groups/css-values-4.d.mts +3 -5
- package/dist/groups/css-values-5.d.mts +3 -5
- package/dist/groups/css-variables-2.d.mts +2 -4
- package/dist/groups/css-view-transitions-2.d.mts +3 -5
- package/dist/groups/css-viewport.d.mts +3 -5
- package/dist/groups/css-will-change-1.d.mts +3 -5
- package/dist/groups/css-writing-modes-4.d.mts +3 -5
- package/dist/groups/css2.d.mts +3 -5
- package/dist/groups/fill-stroke-3.d.mts +3 -5
- package/dist/groups/filter-effects-1.d.mts +3 -5
- package/dist/groups/filter-effects-2.d.mts +3 -5
- package/dist/groups/limited-availability.d.mts +2 -2
- package/dist/groups/mediaqueries-4.d.mts +3 -5
- package/dist/groups/mediaqueries-5.d.mts +3 -5
- package/dist/groups/motion-1.d.mts +3 -5
- package/dist/groups/newly-available/with-downstream.d.mts +3 -5
- package/dist/groups/newly-available.d.mts +3 -5
- package/dist/groups/not-discouraged.d.mts +3 -5
- package/dist/groups/scroll-animations-1.d.mts +3 -5
- package/dist/groups/selectors-4.d.mts +2 -4
- package/dist/groups/selectors-5.d.mts +2 -4
- package/dist/groups/widely-available/with-downstream.d.mts +3 -5
- package/dist/groups/widely-available.d.mts +3 -5
- package/dist/index.d.mts +5 -8
- package/dist/index.mjs +18 -16
- package/dist/{instrument-C7Am_dJ3.mjs → instrument-BN47aTEW.mjs} +3 -5
- package/dist/{lowered-CKSYUc0i.mjs → lowered-DOJEDRFM.mjs} +2 -3
- package/dist/{node-BABEZ2oF.d.mts → node-CnkQisiV.d.mts} +1 -5
- package/dist/parent-vars.d.mts +0 -2
- package/dist/parent-vars.mjs +1 -2
- package/dist/plugin-types.d.mts +1 -5
- package/dist/plugin.d.mts +2 -2
- package/dist/plugin.mjs +1 -2
- package/dist/{registry-ByrYF2v5.mjs → registry-8sYvlzyn.mjs} +2 -4
- package/dist/{runtime-Dt4Tm0Q7.d.mts → runtime-Cv7hGrWf.d.mts} +0 -2
- package/dist/runtime.d.mts +1 -3
- package/dist/runtime.mjs +1 -2
- package/dist/{scope-1R_Np2Mj.d.mts → scope-5A3kbBoQ.d.mts} +1685 -12
- package/dist/{sheet-BT2R1wk_.mjs → sheet-qCuMvyUo.mjs} +7 -13
- package/dist/surface.d.mts +2 -4
- package/dist/surface.mjs +2 -3
- package/dist/{theme-WGcgMD4V.mjs → theme-DBCyDih4.mjs} +7 -11
- package/dist/{theme-types-BY0mRf3K.d.mts → theme-types-CplLnGgG.d.mts} +1684 -11
- package/dist/{trace-otlp-CbKFDsn9.mjs → trace-otlp-DP2syBvD.mjs} +1 -2
- package/dist/tui-types.d.mts +1 -3
- package/dist/tui.d.mts +1 -2
- package/dist/tui.mjs +6 -7
- package/dist/types.d.mts +2 -2
- package/dist/vite.d.mts +3 -11
- package/dist/vite.mjs +11 -16
- package/docs/API.md +135 -4
- package/package.json +3 -3
- package/dist/color-C8OzjAeg.mjs +0 -2
- package/dist/group-common-3PAVTxpd.d.mts +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as MacroError, f as MemberError, o as warn, t as Registry } from "./registry-
|
|
1
|
+
import { d as MacroError, f as MemberError, o as warn, t as Registry } from "./registry-8sYvlzyn.mjs";
|
|
2
2
|
import { browsers, lacking, messageOf, supportOf } from "@cssints/css-grammar/support";
|
|
3
3
|
import { Effect, Formatter, Result, Schema } from "effect";
|
|
4
4
|
import { longhands } from "@cssints/css-grammar/longhands";
|
|
5
|
-
|
|
5
|
+
// src/leaves.ts
|
|
6
6
|
const leaves = (p) => longhands[p] ?? [p];
|
|
7
7
|
const width = (p) => leaves(p).length;
|
|
8
8
|
const SIDE = [
|
|
@@ -80,8 +80,7 @@ function relation(a, b) {
|
|
|
80
80
|
if (ab || ba) return "contains";
|
|
81
81
|
return meet(a, b) ? "overlap" : "apart";
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
//#region src/delivery.ts
|
|
83
|
+
// src/delivery.ts
|
|
85
84
|
/** The name of the runtime of derived tokens (derived.ts): not a plugin's, the engine registers it (derived-data.ts). */
|
|
86
85
|
const DERIVED = "derived";
|
|
87
86
|
const RUNTIME_ID = "virtual:cssints/runtime/";
|
|
@@ -166,8 +165,7 @@ const runtimeModule = Effect.fnUntraced(function* (name) {
|
|
|
166
165
|
if (parentVars?.length && (yield* needed(runtime))) out += `import parentVars from "cssints/parent-vars";\nparentVars(${Formatter.formatJson(parentVars)});\n`;
|
|
167
166
|
return out || "export {};";
|
|
168
167
|
});
|
|
169
|
-
|
|
170
|
-
//#region src/kernel.ts
|
|
168
|
+
// src/kernel.ts
|
|
171
169
|
const KERNEL = "@kernel ";
|
|
172
170
|
/** The support warnings of the declarations of a kernel written as styles (scope-engine.ts), weighed by `addKernel`. */
|
|
173
171
|
const kernelWarnings = /* @__PURE__ */ new WeakMap();
|
|
@@ -229,8 +227,7 @@ const addKernel = Effect.fnUntraced(function* (kernel, markers, at, runtimes = [
|
|
|
229
227
|
}
|
|
230
228
|
});
|
|
231
229
|
const kernelEntries = ({ kernels }, file) => [...kernels.values()].flatMap((e) => e.users.has(file) ? [`${KERNEL}${Formatter.formatJson(e.kernel)}`] : []);
|
|
232
|
-
|
|
233
|
-
//#region src/derived.ts
|
|
230
|
+
// src/derived.ts
|
|
234
231
|
/** The custom property of :root that carries the data (derived-data.ts writes it). */
|
|
235
232
|
const KEY = "--_derived";
|
|
236
233
|
const mul = (m, v) => [
|
|
@@ -561,8 +558,7 @@ const css = (c) => {
|
|
|
561
558
|
const [r, g, b] = conv(c, "srgb").c.map((v) => Math.round(Math.min(1, Math.max(0, v)) * 255));
|
|
562
559
|
return `rgb(${r} ${g} ${b}${c.a < 1 ? ` / ${+c.a.toFixed(3)}` : ""})`;
|
|
563
560
|
};
|
|
564
|
-
|
|
565
|
-
//#region src/derived-data.ts
|
|
561
|
+
// src/derived-data.ts
|
|
566
562
|
const refuses = (literal) => {
|
|
567
563
|
const tried = Result.try({
|
|
568
564
|
try: () => evaluate(literal),
|
|
@@ -619,8 +615,7 @@ const derivedRule = Effect.fnUntraced(function* (properties, keys) {
|
|
|
619
615
|
});
|
|
620
616
|
return `:root{${KEY}:'${json.replace(/[\\']/g, "\\$&")}'}`;
|
|
621
617
|
});
|
|
622
|
-
|
|
623
|
-
//#region src/sheet.ts
|
|
618
|
+
// src/sheet.ts
|
|
624
619
|
const fromJson = Schema.decodeSync(Schema.fromJsonString(Schema.Unknown));
|
|
625
620
|
const THEME = "@theme ";
|
|
626
621
|
const LAYERS = "@layer _.k, _.a, _.b, _.c, _.d, _.e;";
|
|
@@ -753,5 +748,4 @@ const renderSheet = Effect.fn("cssints.renderSheet")(function* (entries) {
|
|
|
753
748
|
closeWrap();
|
|
754
749
|
return layer ? `${out}}\n` : out;
|
|
755
750
|
});
|
|
756
|
-
//#endregion
|
|
757
751
|
export { fallbackEntries as C, relation as D, covers as E, addRuntime as S, runtimeNames as T, addKernel as _, closeNames as a, DERIVED as b, layerEntries as c, requireLayer as d, themedEntries as f, evaluate as g, css as h, byOrder as i, layerStatements as l, usesDerived as m, addGlobal as n, globalEntries as o, standIn as p, addLayers as r, globalNames as s, LAYERS as t, renderSheet as u, kernelEntries as v, runtimeModule as w, RUNTIME_ID as x, kernelWarnings as y };
|
package/dist/surface.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as AliasesOf } from "./scope-
|
|
2
|
-
//#region src/surface.d.ts
|
|
1
|
+
import { t as AliasesOf } from "./scope-5A3kbBoQ.mjs";
|
|
3
2
|
/**
|
|
4
3
|
* `surface().color(t.color.canvas).lighten(0.06).ink()`: a background that follows from the surface around it, however
|
|
5
4
|
* many plain wrappers sit between. `color(<color>)` is an absolute base (default: the parent surface); `lighten(step)`,
|
|
@@ -224,5 +223,4 @@ export declare const surface: () => import("cssints/plugin").Chain<"surface", {
|
|
|
224
223
|
};
|
|
225
224
|
};
|
|
226
225
|
};
|
|
227
|
-
}>>;
|
|
228
|
-
//#endregion
|
|
226
|
+
}>>;
|
package/dist/surface.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as frameScope } from "./frame-
|
|
1
|
+
import { n as frameScope } from "./frame-DqwCA4OH.mjs";
|
|
2
2
|
import { scope } from "cssints/plugin";
|
|
3
|
-
|
|
3
|
+
// src/surface.ts
|
|
4
4
|
const registered = (names, inherits) => names.map((n) => `@property --_${n} { syntax: "<color>"; inherits: ${inherits}; initial-value: canvas; }`).join("\n");
|
|
5
5
|
const shift = (parent) => `oklch(from var(--_k, var(${parent})) calc(l + var(--_d)) c h)`;
|
|
6
6
|
const css = `
|
|
@@ -97,5 +97,4 @@ const surfaceScope = scope("surface", {
|
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
const { surface } = surfaceScope.export();
|
|
100
|
-
//#endregion
|
|
101
100
|
export { surface, surfaceScope };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as registry, d as MacroError, f as MemberError, o as warn } from "./registry-
|
|
2
|
-
import { D as relation, E as covers, d as requireLayer, p as standIn } from "./sheet-
|
|
3
|
-
import { t as fallbackOf } from "./lowered-
|
|
1
|
+
import { a as registry, d as MacroError, f as MemberError, o as warn } from "./registry-8sYvlzyn.mjs";
|
|
2
|
+
import { D as relation, E as covers, d as requireLayer, p as standIn } from "./sheet-qCuMvyUo.mjs";
|
|
3
|
+
import { t as fallbackOf } from "./lowered-DOJEDRFM.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { checkSelector } from "@cssints/css-grammar/check";
|
|
6
6
|
import { browsers, supportOf } from "@cssints/css-grammar/support";
|
|
@@ -12,7 +12,7 @@ import { properties } from "@cssints/css-grammar/mdn";
|
|
|
12
12
|
import { relative } from "node:path";
|
|
13
13
|
import { DTCG_TYPES, TOKEN_TYPES, grammarOf } from "@cssints/css-grammar/token";
|
|
14
14
|
import { matches } from "@cssints/css-grammar/twin";
|
|
15
|
-
|
|
15
|
+
// src/node.ts
|
|
16
16
|
const plain = (method) => {
|
|
17
17
|
throw fail(`cssints: plain styles do not chain (.${method}); merge them with cn(...)`);
|
|
18
18
|
};
|
|
@@ -45,8 +45,7 @@ function probed(value, properties) {
|
|
|
45
45
|
for (const [, name] of value.matchAll(VAR)) n = Math.max(n, probesOf(name).length);
|
|
46
46
|
return Array.from({ length: n }, (_, i) => value.replace(VAR, (m, name) => probesOf(name)[i] ?? probesOf(name)[0] ?? m));
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
//#region src/lib.ts
|
|
48
|
+
// src/lib.ts
|
|
50
49
|
const isFallback = (v) => !!v && typeof v === "object" && "__fallback" in v;
|
|
51
50
|
const edge = (program) => {
|
|
52
51
|
const exit = Effect.runSyncExit(program);
|
|
@@ -320,8 +319,7 @@ function hashClass([p, v, conds, fallbacks]) {
|
|
|
320
319
|
for (const c of text) h = (h << 5) + h + c.charCodeAt(0) | 0;
|
|
321
320
|
return "_" + (h >>> 0).toString(36);
|
|
322
321
|
}
|
|
323
|
-
|
|
324
|
-
//#region src/token.ts
|
|
322
|
+
// src/token.ts
|
|
325
323
|
var CSSTokenValue = class extends CSSStyleValue {
|
|
326
324
|
name;
|
|
327
325
|
syntax;
|
|
@@ -480,8 +478,7 @@ const token = {
|
|
|
480
478
|
...Object.fromEntries(Object.keys(TOKEN_TYPES).map((kind) => [kind, make(kind)])),
|
|
481
479
|
set
|
|
482
480
|
};
|
|
483
|
-
|
|
484
|
-
//#region src/theme.ts
|
|
481
|
+
// src/theme.ts
|
|
485
482
|
const accessOf = (key) => /^\d/.test(key) ? `_${key}` : key;
|
|
486
483
|
const SUPPORTED = Object.keys(DTCG_TYPES).join(", ");
|
|
487
484
|
const COLOR_FN = {
|
|
@@ -927,5 +924,4 @@ const contrast = (...args) => edge(Effect.gen(function* () {
|
|
|
927
924
|
return DONE;
|
|
928
925
|
}));
|
|
929
926
|
const check = { contrast };
|
|
930
|
-
//#endregion
|
|
931
927
|
export { camel as A, hashClass as C, settled as D, minWidth as E, probed as F, failIn as M, isNode as N, toDecls as O, node as P, edge as S, merged as T, PSEUDOS as _, createTokens as a, checkVars as b, tokensOf as c, style as d, token as f, PROPS as g, LAYER as h, createGlobalTheme as i, fail as j, VAR as k, CSSTokenValue as l, FUNCTIONS as m, addTheme as n, isDone as o, CONTEXTS as p, check as r, sets as s, DONE as t, isStyle as u, carried as v, isFallback as w, dropsOf as x, chainDecl as y };
|