Themes

Tokens come from an inline DTCG-shaped const object. Every leaf is a token (see "Tokens") reached by property access. Values are DTCG values or CSS strings checked by the grammar of their $type. Aliases use DTCG {path} references.

import * as import csscss from "cssints" with { type: "cssints" };

const 
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
= import csscss.
const createTokens: <{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>(tokens: {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
} & ValidGroup<...>, name?: (path: readonly string[]) => string | TokenName) => css.Tokens<...>
Tokens from an inline DTCG-shaped `const` object: `$type` is inherited through groups, a leaf is `{ $value }`, a value is a DTCG value or a CSS string of the type's grammar, an alias is `"{group.token}"`. The variable is the kebab-case path (`--color-bg`), or what the mapper returns for the path.
createTokens
({
color: {
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
} & ValidGroup<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
color
: {
$type: "color"$type: "color",
bg: {
    readonly $value: "#ffffff";
}
bg
: { $value: "#ffffff"$value: "#ffffff" },
fg: {
    readonly $value: "#111827";
}
fg
: { $value: "#111827"$value: "#111827" },
accent: {
    readonly $value: "oklch(62% 0.19 259)";
}
accent
: { $value: "oklch(62% 0.19 259)"$value: "oklch(62% 0.19 259)" },
link: {
    readonly $value: "{color.accent}";
}
link
: { $value: "{color.accent}"$value: "{color.accent}" },
},
space: {
    readonly $type: "dimension";
    readonly md: {
        readonly $value: "16px";
    };
} & ValidGroup<{
    readonly $type: "dimension";
    readonly md: {
        readonly $value: "16px";
    };
}, "dimension", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
space
: { $type: "dimension"$type: "dimension",
md: {
    readonly $value: "16px";
}
md
: { $value: "16px"$value: "16px" } },
}); const const dark: css.QueryWrapdark = import csscss.
const media: Condition
<"(prefers-color-scheme: dark)">(query: "(prefers-color-scheme: dark)") => css.QueryWrap (+2 overloads)
media
("(prefers-color-scheme: dark)");
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>, {
    ...;
}, string>(tokens: css.Tokens<...>, condition: css.QueryWrap | string, overrides: {
    ...;
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
, const dark: css.QueryWrapdark, {
color: {
    readonly bg: "#0b0b0f";
    readonly fg: "#f3f4f6";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>, {
    readonly bg: "#0b0b0f";
    readonly fg: "#f3f4f6";
}, css.Tokens<...>>
color
: { bg: "#0b0b0f"bg: "#0b0b0f", fg: "#f3f4f6"fg: "#f3f4f6" } });
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>, {
    ...;
}, string>(tokens: css.Tokens<...>, condition: css.QueryWrap | string, overrides: {
    ...;
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
, ".light", {
color: {
    readonly bg: "#fff";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>, {
    readonly bg: "#fff";
}, css.Tokens<...>>
color
: { bg: "#fff"bg: "#fff" } });
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>, {
    ...;
}, string>(tokens: css.Tokens<...>, condition: css.QueryWrap | string, overrides: {
    ...;
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
.
color: css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
color
, import csscss.
const container: Condition
<"(width < 30rem)">(query: "(width < 30rem)") => css.QueryWrap (+2 overloads)
container
("(width < 30rem)"), { bg: "#eee"bg: "#eee" });
import csscss.
const check: {
    readonly contrast: <F extends TokenType, B extends TokenType>(fg: Token<F, boolean> & ColourOrAny<F>, bg: Token<B, boolean> & ColourOrAny<B>, options: {
        readonly min: number;
    }) => void;
}
Build-time checks over tokens.
check
.
contrast: <"color", "color">(fg: Token<"color", boolean, string>, bg: Token<"color", boolean, string>, options: {
    readonly min: number;
}) => void
WCAG 2.x contrast of `fg` on `bg`, for the defaults and every theme that affects either; below `min` is a build error. A token from a JSON import has every type to the editor, so it fits; the build checks it is a colour.
contrast
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
.
color: css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
color
.fg: Token<"color", true, "#111827">fg,
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
.
color: css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
color
.bg: Token<"color", true, "#ffffff">bg, { min: numbermin: 4.5 });
export const const A: () => anyA = () => <IntrinsicElements[string]: anydiv className?: string | undefinedclassName={import csscss.const cn: (...styles: css.Style[]) => css.Stylecn(import csscss.const bg: <readonly [Token<"color", true, "#ffffff">]>(parts_0: Token<"color", true, "#ffffff">) => css.Style
`<color>`. Chrome 1, Edge 12, Firefox 1, Safari 1, iOS 1, Android 18. [MDN](https://developer.mozilla.org/docs/Web/CSS/background-color)
bg
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
.
color: css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
color
.bg: Token<"color", true, "#ffffff">bg), import csscss.const color: <readonly [Token<"color", true, "#111827">]>(parts_0: Token<"color", true, "#111827">) => css.Style
`<color>`. Chrome 1, Edge 12, Firefox 1, Safari 1, iOS 1, Android 18. [MDN](https://developer.mozilla.org/docs/Web/CSS/color)
color
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
.
color: css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
color
.fg: Token<"color", true, "#111827">fg), import csscss.const p: <readonly [Token<"length", true, "16px">]>(parts_0: Token<"length", true, "16px">) => css.Style
`<'padding-top'>{1,4}`. Chrome 1, Edge 12, Firefox 1, Safari 1, iOS 1, Android 18. [MDN](https://developer.mozilla.org/docs/Web/CSS/padding)
p
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
.
space: css.Tokens<{
    readonly $type: "dimension";
    readonly md: {
        readonly $value: "16px";
    };
}, "dimension", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
space
.md: Token<"length", true, "16px">md))} />;
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>, css.Overrides<...>, string>(tokens: css.Tokens<...>, condition: css.QueryWrap | string, overrides: css.Overrides<...> & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
, const dark: css.QueryWrapdark, {
color?: (css.Overrides<css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>> & css.CheckOverrides<...>) | undefined
color
: { nope: "red" } }); // error: no token at this path
Object literal may only specify known properties, and 'nope' does not exist in type 'Overrides<Tokens<{ readonly $type: "color"; readonly bg: { readonly $value: "#ffffff"; }; readonly fg: { readonly $value: "#111827"; }; readonly accent: { readonly $value: "oklch(62% 0.19 259)"; }; readonly link: { ...; }; }, "color", { ...; }>> & CheckOverrides<...>'.
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>, {
    ...;
}, string>(tokens: css.Tokens<...>, condition: css.QueryWrap | string, overrides: {
    ...;
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>
t
, css.hover, {
color: {
    readonly bg: "red";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#ffffff";
    };
    readonly fg: {
        readonly $value: "#111827";
    };
    readonly accent: {
        readonly $value: "oklch(62% 0.19 259)";
    };
    readonly link: {
        readonly $value: "{color.accent}";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#ffffff";
        };
        readonly fg: {
            readonly $value: "#111827";
        };
        readonly accent: {
            readonly $value: "oklch(62% 0.19 259)";
        };
        readonly link: {
            readonly $value: "{color.accent}";
        };
    };
    readonly space: {
        readonly $type: "dimension";
        readonly md: {
            readonly $value: "16px";
        };
    };
}>, {
    readonly bg: "red";
}, css.Tokens<...>>
color
: { bg: "red"bg: "red" } }); // error: a pseudo-class is not a theme condition
Argument of type 'StateWrap' is not assignable to parameter of type 'string | QueryWrap'. Type 'StateWrap' is not assignable to type 'QueryWrap'. Type 'StateWrap' is not assignable to type '{ readonly __query: true; }'.
import * as import csscss from "cssints" with { type: "cssints" };

import csscss.
const layers: (...names: readonly [string, ...string[]] | readonly [string, ...string[], {
    readonly before: boolean;
}]) => void
Declares top-level layers in order, printed once after the engine's own (`@layer app, author, viewer;`), so what is in them beats the engine's `:root` fallbacks; `{ before: true }` at the end prints them before the engine's, below every class (`layers("reset", { before: true })`). A theme's `layer` and a plugin's rules must name a declared layer. The same names again are fine; the same names in another order, or both before and after, are a build error.
layers
("app", "author", "viewer");
const
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>
t
= import csscss.
const createTokens: <{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>(tokens: {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
} & ValidGroup<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, name?: (path: readonly string[]) => string | TokenName) => css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>
Tokens from an inline DTCG-shaped `const` object: `$type` is inherited through groups, a leaf is `{ $value }`, a value is a DTCG value or a CSS string of the type's grammar, an alias is `"{group.token}"`. The variable is the kebab-case path (`--color-bg`), or what the mapper returns for the path.
createTokens
({
color: {
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#fff";
    };
} & ValidGroup<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#fff";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>
color
: { $type: "color"$type: "color",
bg: {
    readonly $value: "#fff";
}
bg
: { $value: "#fff"$value: "#fff" } } });
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, {
    readonly color: {
        readonly bg: "#000";
    };
}, string>(tokens: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, condition: css.QueryWrap | string, overrides: {
    readonly color: {
        readonly bg: "#000";
    };
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>
t
, '[data-mode="dark"]', {
color: {
    readonly bg: "#000";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#fff";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, {
    readonly bg: "#000";
}, css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>>
color
: { bg: "#000"bg: "#000" } }, { layer?: string | undefinedlayer: "viewer" });
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, {
    readonly color: {
        readonly bg: "#123";
    };
}, "article.post">(tokens: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, condition: css.QueryWrap | string, overrides: {
    readonly color: {
        readonly bg: "#123";
    };
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>
t
, '[data-mode="hero"]', {
color: {
    readonly bg: "#123";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#fff";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, {
    readonly bg: "#123";
}, css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>>
color
: { bg: "#123"bg: "#123" } }, { layer?: string | undefinedlayer: "author", scope?: "article.post" | undefinedscope: "article.post" });
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, {
    readonly color: {
        readonly bg: "#000";
    };
}, "a[href">(tokens: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, condition: css.QueryWrap | string, overrides: {
    readonly color: {
        readonly bg: "#000";
    };
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>
t
, ".x", {
color: {
    readonly bg: "#000";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "color";
    readonly bg: {
        readonly $value: "#fff";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>, {
    readonly bg: "#000";
}, css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly bg: {
            readonly $value: "#fff";
        };
    };
}>>
color
: { bg: "#000"bg: "#000" } }, { scope: "a[href" }); // error: unbalanced brackets in the scope
Type '"a[href"' is not assignable to type '"global(): unbalanced brackets or quotes in \"a[href\""'.
css.layers(); // error: a declaration has a name
Argument of type '[]' is not assignable to parameter of type 'readonly [string, ...string[]] | readonly [string, ...string[], { readonly before: boolean; }]'. Type '[]' is not assignable to type 'readonly [string, ...string[], { readonly before: boolean; }]'. Source has 0 element(s) but target requires 2.
import csscss.
const layers: (...names: readonly [string, ...string[]] | readonly [string, ...string[], {
    readonly before: boolean;
}]) => void
Declares top-level layers in order, printed once after the engine's own (`@layer app, author, viewer;`), so what is in them beats the engine's `:root` fallbacks; `{ before: true }` at the end prints them before the engine's, below every class (`layers("reset", { before: true })`). A theme's `layer` and a plugin's rules must name a declared layer. The same names again are fine; the same names in another order, or both before and after, are a build error.
layers
("reset", { before: booleanbefore: true }); // @layer reset; before @layer _.k, _.a, …;
import * as import csscss from "cssints" with { type: "cssints" };

export const 
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}>
t
= import csscss.
const createTokens: <{
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}>(tokens: {
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
} & ValidGroup<{
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}>, name?: (path: readonly string[]) => string | TokenName) => css.Tokens<...>
Tokens from an inline DTCG-shaped `const` object: `$type` is inherited through groups, a leaf is `{ $value }`, a value is a DTCG value or a CSS string of the type's grammar, an alias is `"{group.token}"`. The variable is the kebab-case path (`--color-bg`), or what the mapper returns for the path.
createTokens
({
color: {
    readonly $type: "color";
    readonly accent: {
        readonly $value: "#2563eb";
    };
    readonly hover: {
        readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
    };
} & ValidGroup<{
    readonly $type: "color";
    readonly accent: {
        readonly $value: "#2563eb";
    };
    readonly hover: {
        readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}>
color
: {
$type: "color"$type: "color",
accent: {
    readonly $value: "#2563eb";
}
accent
: { $value: "#2563eb"$value: "#2563eb" },
hover: {
    readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
}
hover
: { $value: "color-mix(in oklab, {color.accent}, black 15%)"$value: "color-mix(in oklab, {color.accent}, black 15%)" },
}, }); import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}>, {
    readonly color: {
        readonly accent: "#db2777";
    };
}, string>(tokens: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}>, condition: css.QueryWrap | string, overrides: {
    readonly color: {
        readonly accent: "#db2777";
    };
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}>
t
, ".brand", {
color: {
    readonly accent: "#db2777";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "color";
    readonly accent: {
        readonly $value: "#2563eb";
    };
    readonly hover: {
        readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
    };
}, "color", {
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}>, {
    readonly accent: "#db2777";
}, css.Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "#2563eb";
        };
        readonly hover: {
            readonly $value: "color-mix(in oklab, {color.accent}, black 15%)";
        };
    };
}>>
color
: { accent: "#db2777"accent: "#db2777" } }); // hover follows
import * as import csscss from "cssints" with { type: "cssints" };

export const 
const t: css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>
t
= import csscss.
const createTokens: <{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>(tokens: {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
} & ValidGroup<...>, name?: (path: readonly string[]) => string | TokenName) => css.Tokens<...>
Tokens from an inline DTCG-shaped `const` object: `$type` is inherited through groups, a leaf is `{ $value }`, a value is a DTCG value or a CSS string of the type's grammar, an alias is `"{group.token}"`. The variable is the kebab-case path (`--color-bg`), or what the mapper returns for the path.
createTokens
({
hue: {
    readonly $type: "number";
    readonly accent: {
        readonly $value: 345;
    };
} & ValidGroup<{
    readonly $type: "number";
    readonly accent: {
        readonly $value: 345;
    };
}, "number", {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>
hue
: { $type: "number"$type: "number",
accent: {
    readonly $value: 345;
}
accent
: { $value: 345$value: 345 } },
radius: {
    readonly $type: "dimension";
    readonly sm: {
        readonly $value: "4px";
    };
    readonly md: {
        readonly $value: "8px";
    };
} & ValidGroup<{
    readonly $type: "dimension";
    readonly sm: {
        readonly $value: "4px";
    };
    readonly md: {
        readonly $value: "8px";
    };
}, "dimension", {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>
radius
: { $type: "dimension"$type: "dimension",
sm: {
    readonly $value: "4px";
}
sm
: { $value: "4px"$value: "4px" },
md: {
    readonly $value: "8px";
}
md
: { $value: "8px"$value: "8px" } },
color: {
    readonly $type: "color";
    readonly accent: {
        readonly $value: "oklch(0.6 0.2 {hue.accent})";
    };
} & ValidGroup<{
    readonly $type: "color";
    readonly accent: {
        readonly $value: "oklch(0.6 0.2 {hue.accent})";
    };
}, "color", {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>
color
: { $type: "color"$type: "color",
accent: {
    readonly $value: "oklch(0.6 0.2 {hue.accent})";
}
accent
: { $value: "oklch(0.6 0.2 {hue.accent})"$value: "oklch(0.6 0.2 {hue.accent})" } },
}); import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>, {
    ...;
}, string>(tokens: css.Tokens<...>, condition: css.QueryWrap | string, overrides: {
    ...;
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>
t
, ".square", {
radius: {
    readonly md: "{radius.sm}";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "dimension";
    readonly sm: {
        readonly $value: "4px";
    };
    readonly md: {
        readonly $value: "8px";
    };
}, "dimension", {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>, {
    readonly md: "{radius.sm}";
}, css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>>
radius
: { md: "{radius.sm}"md: "{radius.sm}" } });
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>, {
    ...;
}, string>(tokens: css.Tokens<...>, condition: css.QueryWrap | string, overrides: {
    ...;
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>
t
, ".dim", {
hue: {
    readonly accent: 12;
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "number";
    readonly accent: {
        readonly $value: 345;
    };
}, "number", {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>, {
    readonly accent: 12;
}, css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>>
hue
: { accent: 12accent: 12 },
color: {
    readonly accent: "oklch(0.7 0.1 {hue.accent})";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "color";
    readonly accent: {
        readonly $value: "oklch(0.6 0.2 {hue.accent})";
    };
}, "color", {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>, {
    readonly accent: "oklch(0.7 0.1 {hue.accent})";
}, css.Tokens<...>>
color
: { accent: "oklch(0.7 0.1 {hue.accent})"accent: "oklch(0.7 0.1 {hue.accent})" } });
import csscss.
const createGlobalTheme: <css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>, {
    ...;
}, string>(tokens: css.Tokens<...>, condition: css.QueryWrap | string, overrides: {
    ...;
} & css.CheckOverrides<...>, options?: {
    ...;
} | undefined) => void
Re-declares the overridden tokens under a media or container condition (on `:root`), or under a selector, and the aliases that depend on them. An unknown path and a value that is not of the token's type are type errors. `layer` puts the rule in a top-level layer that `layers()` declares (the build checks that it does); `scope` (with a selector) confines it to a subtree: `@scope (<scope>) { ... }`.
createGlobalTheme
(
const t: css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>
t
, ".x", {
radius: {
    readonly md: "{hue.accent}";
} & css.CheckOverrides<css.Tokens<{
    readonly $type: "dimension";
    readonly sm: {
        readonly $value: "4px";
    };
    readonly md: {
        readonly $value: "8px";
    };
}, "dimension", {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>, {
    readonly md: "{hue.accent}";
}, css.Tokens<{
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}, undefined, {
    readonly hue: {
        readonly $type: "number";
        readonly accent: {
            readonly $value: 345;
        };
    };
    readonly radius: {
        readonly $type: "dimension";
        readonly sm: {
            readonly $value: "4px";
        };
        readonly md: {
            readonly $value: "8px";
        };
    };
    readonly color: {
        readonly $type: "color";
        readonly accent: {
            readonly $value: "oklch(0.6 0.2 {hue.accent})";
        };
    };
}>>
radius
: { md: "{hue.accent}" } }); // error: a number, not a length
Type '"{hue.accent}"' is not assignable to type '"{hue.accent}" & Bad<"{hue.accent} is a number, not a length">'. Type 'string' is not assignable to type 'Bad<"{hue.accent} is a number, not a length">'.
import StyleDictionary from "style-dictionary";
import { register } from "@tokens-studio/sd-transforms";

register(StyleDictionary);
const DTCG = { fontSize: "dimension", lineHeight: "number", opacity: "number" }; // the types sd-transforms leaves
StyleDictionary.registerFormat({
	name: "cssints/dtcg",
	format: ({ dictionary }) => {
		const out = {};
		for (const t of dictionary.allTokens) {
			let group = out;
			for (const key of t.path.slice(0, -1)) group = group[key] ??= {};
			const type = t.$type ?? t.type;
			group[t.path.at(-1)] = { $type: DTCG[type] ?? type, $value: t.$value ?? t.value };
		}
		return JSON.stringify(out, null, 2);
	},
});
await new StyleDictionary({
	source: ["tokens/**/*.json"],
	preprocessors: ["tokens-studio"],
	platforms: { cssints: { transformGroup: "tokens-studio", files: [{ destination: "tokens.json", format: "cssints/dtcg" }] } },
}).buildAllPlatforms();

Output (the @property rules of space-md and color-fg are not shown):

@layer _.k, _.a, _.b, _.c, _.d, _.e;
@property --color-accent { syntax: "<color>"; inherits: true; initial-value: oklch(62% 0.19 259); }
@property --color-bg { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --color-link { syntax: "<color>"; inherits: true; initial-value: oklch(62% 0.19 259); }
@layer _.k {
	:root { --color-link: var(--color-accent); }
	@media (prefers-color-scheme: dark) {
		:root { --color-bg: #0b0b0f; --color-fg: #f3f4f6; }
	}
	@container (width < 30rem) {
		:where(*) { --color-bg: #eee; }
	}
	.light { --color-bg: #fff; }
}

Derived tokens (contrastColor(), derive()), JSON input with generated types and slot variants are not part of 0.1.