Clay: cssints/clay

A native UI laid out by Clay, with no browser and no JS where it runs (an ESP32's firmware), writes its styles with cssints/clay. The same Vite plugin compiles each site to an object literal shaped as Clay's own structs, and header() prints a module of them as C initializers:

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

export const const pill: css.ClayStylepill = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
import csscss.const width: (value: css.Size) => css.ClayStylewidth(200), import csscss.const height: (value: css.Size) => css.ClayStyleheight(38), import csscss.const justifyContent: (value: css.Align) => css.ClayStylejustifyContent("center"), import csscss.const alignItems: (value: css.Align) => css.ClayStylealignItems("center"), import csscss.const bg: <readonly ["rgb(36 40 52)"]>(parts_0: "rgb(36 40 52)") => css.ClayStyle
`background-color`.
bg
("rgb(36 40 52)"),
import csscss.const borderRadius: (...values: [css.Px] | [css.Px, css.Px] | [css.Px, css.Px, css.Px] | [css.Px, css.Px, css.Px, css.Px]) => css.ClayStyle
1 to 4 radii: top-left, top-right, bottom-right, bottom-left, as in CSS.
borderRadius
(19),
import csscss.const border: <readonly ["#969baa"]>(width: css.Px, color_0: "#969baa") => css.ClayStyle
A border of that width and colour on every side.
border
(1, "#969baa"),
); export const const label: css.ClayStylelabel = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(import csscss.const color: <readonly ["#ebebf0"]>(parts_0: "#ebebf0") => css.ClayStyle
The colour of the text in the element (Clay's `textColor`).
color
("#ebebf0"), import csscss.const fontSize: (value: css.Px) => css.ClayStylefontSize(14));
import csscss.const width: (value: css.Size) => css.ClayStylewidth("10rem"); // error: Clay counts pixels
Argument of type '"10rem"' is not assignable to parameter of type 'Size'.
import csscss.boxShadow("0 0 1px red"); // error: no such member in Clay (a shadow is css.shadow, below)
Property 'boxShadow' does not exist on type 'typeof import("packages/cssints/src/clay-types")'. Did you mean 'shadow'?
static const Clay_ElementDeclaration pill = { .layout = { .sizing = { .width = { .size = { .minMax = { 200, 200 } }, .type = CLAY__SIZING_TYPE_FIXED }, ... }, .backgroundColor = { .r = 36, .g = 40, .b = 52, .a = 255 }, ... };
static const Clay_TextElementConfig label_text = { .textColor = { .r = 235, .g = 235, .b = 240, .a = 255 }, .fontSize = 14 };
CLAY(CLAY_ID("Units"), pill) { CLAY_TEXT(CLAY_STRING("switch to g"), label_text); }
import * as import csscss from "cssints/clay" with { type: "cssints" };

export const 
const t: Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>
t
= import csscss.
createTokens<{
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>(tokens: {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
} & ValidGroup<{
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>, name?: (path: readonly string[]) => string | TokenName): Tokens<...>
export createTokens
Tokens from an inline DTCG-shaped `const` object: `$type` is inherited through groups, a leaf is `{ $value }` or, when a `$type` is in scope, the value itself (`bg: "#ffffff"`), 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 surface: {
        readonly $value: "rgb(36 40 52)";
    };
    readonly pressed: {
        readonly $value: "#ffc878";
    };
} & ValidGroup<{
    readonly $type: "color";
    readonly surface: {
        readonly $value: "rgb(36 40 52)";
    };
    readonly pressed: {
        readonly $value: "#ffc878";
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>
color
: { $type: "color"$type: "color",
surface: {
    readonly $value: "rgb(36 40 52)";
}
surface
: { $value: "rgb(36 40 52)"$value: "rgb(36 40 52)" },
pressed: {
    readonly $value: "#ffc878";
}
pressed
: { $value: "#ffc878"$value: "#ffc878" } },
}); import csscss.
const createGlobalTheme: <Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>, {
    readonly color: {
        readonly surface: "white";
    };
}>(tokens: Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>, name: string, overrides: {
    readonly color: {
        readonly surface: "white";
    };
} & CheckOverrides<...>) => void
A theme of cssints/clay's tokens, by a name that is a C identifier: header() prints every style again, the name appended (`<style>_<name>`, `<style>_hover_<name>`, `<style>_text_<name>`). It applies to the styles evaluated after it.
createGlobalTheme
(
const t: Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>
t
, "light", {
color: {
    readonly surface: "white";
} & CheckOverrides<Tokens<{
    readonly $type: "color";
    readonly surface: {
        readonly $value: "rgb(36 40 52)";
    };
    readonly pressed: {
        readonly $value: "#ffc878";
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>, {
    readonly surface: "white";
}, Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>>
color
: { surface: "white"surface: "white" } });
export const
const font: {
    readonly Roboto: css.ClayStyle;
    readonly Mono: css.ClayStyle;
} & {
    readonly fonts: readonly ["Roboto", "Mono"];
}
font
= import csscss.
const fonts: <readonly ["Roboto", "Mono"]>(names_0: "Roboto", names_1: "Mono") => {
    readonly Roboto: css.ClayStyle;
    readonly Mono: css.ClayStyle;
} & {
    readonly fonts: readonly ["Roboto", "Mono"];
}
The app's fonts in the order of its font array: a style per name that sets Clay's `fontId`, and the list, which header() prints as an enum `<export>_<font>`. Each name is a C identifier.
fonts
("Roboto", "Mono");
export const const units: css.ClayStyleunits = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
import csscss.const width: (value: css.Size) => css.ClayStylewidth(200), import csscss.const bg: <readonly [Token<"color", true, "rgb(36 40 52)">]>(parts_0: Token<"color", true, "rgb(36 40 52)">) => css.ClayStyle
`background-color`.
bg
(
const t: Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>
t
.
color: Tokens<{
    readonly $type: "color";
    readonly surface: {
        readonly $value: "rgb(36 40 52)";
    };
    readonly pressed: {
        readonly $value: "#ffc878";
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>
color
.surface: Token<"color", true, "rgb(36 40 52)">surface),
import csscss.const active: (...styles: css.ClayStyle[]) => css.ClayStyle
Pressed: `<name>_active`.
active
(import csscss.const bg: <readonly [Token<"color", true, "#ffc878">]>(parts_0: Token<"color", true, "#ffc878">) => css.ClayStyle
`background-color`.
bg
(
const t: Tokens<{
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>
t
.
color: Tokens<{
    readonly $type: "color";
    readonly surface: {
        readonly $value: "rgb(36 40 52)";
    };
    readonly pressed: {
        readonly $value: "#ffc878";
    };
}, undefined, {
    readonly color: {
        readonly $type: "color";
        readonly surface: {
            readonly $value: "rgb(36 40 52)";
        };
        readonly pressed: {
            readonly $value: "#ffc878";
        };
    };
}>
color
.pressed: Token<"color", true, "#ffc878">pressed)),
); export const const label: css.ClayStylelabel = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
const font: {
    readonly Roboto: css.ClayStyle;
    readonly Mono: css.ClayStyle;
} & {
    readonly fonts: readonly ["Roboto", "Mono"];
}
font
.type Mono: css.ClayStyleMono, import csscss.const fontSize: (value: css.Px) => css.ClayStylefontSize(14));
import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
const font: {
    readonly Roboto: css.ClayStyle;
    readonly Mono: css.ClayStyle;
} & {
    readonly fonts: readonly ["Roboto", "Mono"];
}
font
.Serif); // error: not one of the fonts
Property 'Serif' does not exist on type '{ readonly Roboto: ClayStyle; readonly Mono: ClayStyle; } & { readonly fonts: readonly ["Roboto", "Mono"]; }'.
#define T(name) (light ? name##_light : name)
CLAY(CLAY_ID("Units"), pressed ? T(units_active) : T(units)) { CLAY_TEXT(CLAY_STRING("switch to g"), label_text); }
import * as import csscss from "cssints/clay" with { type: "cssints" };

export const const menu: css.ClayStylemenu = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
import csscss.const width: (value: css.Size) => css.ClayStylewidth(160), import csscss.const bg: <readonly ["#242834"]>(parts_0: "#242834") => css.ClayStyle
`background-color`.
bg
("#242834"),
import csscss.const float: (options?: css.FloatOptions) => css.ClayStyle
Makes the element float above the others (Clay's `floating`), and sets `attachTo`: to the element it is a child of, to the one `parent` names, or to the root. A float is out of the flow of its siblings and of its parent's size.
float
({ parent?: string | undefined
The string of the element's `CLAY_ID("...")`, ASCII. Default: the element the float is a child of.
parent
: "Units",
attach?: {
    element?: css.AttachPoint;
    parent?: css.AttachPoint;
} | undefined
Which point of the floating element sits on which point of its parent. Default: `left top` on `left top`.
attach
: { parent?: "left bottom" | "left top" | "left center" | "right bottom" | "right top" | "right center" | "center bottom" | "center top" | "center center" | undefinedparent: "left bottom" },
offset?: {
    x?: css.Px;
    y?: css.Px;
} | undefined
Moves the element from where `attach` puts it, in pixels (a negative one goes left or up). Default: 0, 0.
offset
: { y?: css.Px | undefinedy: 4 }, zIndex?: number | undefined
Drawn in ascending order, with all the element's children. Default: 0. A whole number of `int16_t`.
zIndex
: 10 }),
); export const const dialog: css.ClayStyledialog = import csscss.const float: (options?: css.FloatOptions) => css.ClayStyle
Makes the element float above the others (Clay's `floating`), and sets `attachTo`: to the element it is a child of, to the one `parent` names, or to the root. A float is out of the flow of its siblings and of its parent's size.
float
({
root?: boolean | undefined
Attach to the layout's root: absolute positioning, or a dialog centred on the screen.
root
: true,
attach?: {
    element?: css.AttachPoint;
    parent?: css.AttachPoint;
} | undefined
Which point of the floating element sits on which point of its parent. Default: `left top` on `left top`.
attach
: { element?: "left bottom" | "left top" | "left center" | "right bottom" | "right top" | "right center" | "center bottom" | "center top" | "center center" | undefinedelement: "center center", parent?: "left bottom" | "left top" | "left center" | "right bottom" | "right top" | "right center" | "center bottom" | "center top" | "center center" | undefinedparent: "center center" },
}); import csscss.const float: (options?: css.FloatOptions) => css.ClayStyle
Makes the element float above the others (Clay's `floating`), and sets `attachTo`: to the element it is a child of, to the one `parent` names, or to the root. A float is out of the flow of its siblings and of its parent's size.
float
({
attach?: {
    element?: css.AttachPoint;
    parent?: css.AttachPoint;
} | undefined
Which point of the floating element sits on which point of its parent. Default: `left top` on `left top`.
attach
: { element: "top left" } }); // error: a point is x, then y
Type '"top left"' is not assignable to type '"left bottom" | "left top" | "left center" | "right bottom" | "right top" | "right center" | "center bottom" | "center top" | "center center" | undefined'.
static const Clay_ElementDeclaration menu = { .layout = { ... }, .backgroundColor = { ... }, .floating = { .offset = { .x = 0, .y = 4 }, .parentId = 3516868942u, .zIndex = 10, .attachPoints = { .element = CLAY_ATTACH_POINT_LEFT_TOP, .parent = CLAY_ATTACH_POINT_LEFT_BOTTOM }, .attachTo = CLAY_ATTACH_TO_ELEMENT_WITH_ID } };
import * as import csscss from "cssints/clay" with { type: "cssints" };

export const const glyph: css.ClayStyleglyph = import csscss.const image: (src: string, options: css.ImageOptions) => css.ClayStyle
An image element: the path it is loaded from, and its size in whole pixels, which is the element's box. `fit` `"contain"` keeps its proportions in a box another style grows (Clay's `aspectRatio`); the path is passed to the renderer as `imageData`.
image
("examples/sensors/glyph.png", { width: css.Px
The image's width in whole pixels: the element's box starts at the image's own size.
width
: 32, height: css.Px
The image's height in whole pixels.
height
: 32 });
export const const logo: css.ClayStylelogo = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
import csscss.const image: (src: string, options: css.ImageOptions) => css.ClayStyle
An image element: the path it is loaded from, and its size in whole pixels, which is the element's box. `fit` `"contain"` keeps its proportions in a box another style grows (Clay's `aspectRatio`); the path is passed to the renderer as `imageData`.
image
("assets/logo.png", { width: css.Px
The image's width in whole pixels: the element's box starts at the image's own size.
width
: 64, height: css.Px
The image's height in whole pixels.
height
: 32, fit?: "contain" | "fill" | undefined
`"fill"` stretches the image into a box another style gives it; `"contain"` sets Clay's `aspectRatio` to the image's, so a box that grows keeps its proportions. Default: `"fill"`, as CSS's `object-fit`.
fit
: "contain" }),
import csscss.const width: (value: css.Size) => css.ClayStylewidth("stretch"), ); import csscss.const image: (src: string, options: css.ImageOptions) => css.ClayStyle
An image element: the path it is loaded from, and its size in whole pixels, which is the element's box. `fit` `"contain"` keeps its proportions in a box another style grows (Clay's `aspectRatio`); the path is passed to the renderer as `imageData`.
image
("logo.png", { width: css.Px
The image's width in whole pixels: the element's box starts at the image's own size.
width
: 64, height: css.Px
The image's height in whole pixels.
height
: 32, fit: "cover" }); // error: fill or contain
Type '"cover"' is not assignable to type '"contain" | "fill" | undefined'.
static const Clay_ElementDeclaration glyph = { .layout = { .sizing = { .width = { .size = { .minMax = { 32, 32 } }, .type = CLAY__SIZING_TYPE_FIXED }, .height = { .size = { .minMax = { 32, 32 } }, .type = CLAY__SIZING_TYPE_FIXED } } }, .image = { .imageData = (void *)"examples/sensors/glyph.png" } };
import * as import csscss from "cssints/clay" with { type: "cssints" };

export const const panel: css.ClayStylepanel = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
import csscss.const width: (value: css.Size) => css.ClayStylewidth(280), import csscss.const bg: <readonly ["#242834"]>(parts_0: "#242834") => css.ClayStyle
`background-color`.
bg
("#242834"),
import csscss.const borderRadius: (...values: [css.Px] | [css.Px, css.Px] | [css.Px, css.Px, css.Px] | [css.Px, css.Px, css.Px, css.Px]) => css.ClayStyle
1 to 4 radii: top-left, top-right, bottom-right, bottom-left, as in CSS.
borderRadius
(12),
import csscss.const shadow: (options?: css.ShadowOptions) => css.ClayStyle
A shadow of the element: a renderer effect, not a Clay field (Clay 1.0 has none), so `header()` prints nothing for it and the C targets ignore it until a page draws it themselves. The declaration keeps the layout; the renderer draws the element's own box, offset by `x`/`y` and blurred by `blur`, in `color`, before the element's command. The element needs an `id`: the renderer keys the shadow by Clay's element id.
shadow
({ y?: css.Px | undefined
Moves the shadow down (or up, negative). Default: 2.
y
: 12, blur?: css.Px | undefined
The blur radius in pixels: the width of the soft edge, not negative. Default: 12.
blur
: 24, color?: string | undefined
The colour of the shadow, as any colour a Clay page can draw. Default: `rgb(0 0 0 / 0.4)`.
color
: "rgb(0 0 0 / 0.45)" }),
); import csscss.const shadow: (options?: css.ShadowOptions) => css.ClayStyle
A shadow of the element: a renderer effect, not a Clay field (Clay 1.0 has none), so `header()` prints nothing for it and the C targets ignore it until a page draws it themselves. The declaration keeps the layout; the renderer draws the element's own box, offset by `x`/`y` and blurred by `blur`, in `color`, before the element's command. The element needs an `id`: the renderer keys the shadow by Clay's element id.
shadow
({ spread: 2 }); // error: the box is the element's own
Object literal may only specify known properties, and 'spread' does not exist in type 'ShadowOptions'.
import csscss.const shadow: (options?: css.ShadowOptions) => css.ClayStyle
A shadow of the element: a renderer effect, not a Clay field (Clay 1.0 has none), so `header()` prints nothing for it and the C targets ignore it until a page draws it themselves. The declaration keeps the layout; the renderer draws the element's own box, offset by `x`/`y` and blurred by `blur`, in `color`, before the element's command. The element needs an `id`: the renderer keys the shadow by Clay's element id.
shadow
({ blur: "1rem" }); // error: a blur is pixels
Type '"1rem"' is not assignable to type 'Px | undefined'.
// no shadow here: a renderer effect, not a Clay field
static const Clay_ElementDeclaration panel = { .layout = { .sizing = { .width = { .size = { .minMax = { 280, 280 } }, .type = CLAY__SIZING_TYPE_FIXED } } }, .backgroundColor = { .r = 36, .g = 40, .b = 52, .a = 255 }, .cornerRadius = { .topLeft = 12, .topRight = 12, .bottomRight = 12, .bottomLeft = 12 } };
import * as import csscss from "cssints/clay" with { type: "cssints" };

// a menu: the page shows through its fill, blurred; its own text is drawn after the blur
export const const menu: css.ClayStylemenu = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
import csscss.const width: (value: css.Size) => css.ClayStylewidth(150), import csscss.const bg: <readonly ["rgb(23 27 32 / 0.72)"]>(parts_0: "rgb(23 27 32 / 0.72)") => css.ClayStyle
`background-color`.
bg
("rgb(23 27 32 / 0.72)"),
import csscss.const borderRadius: (...values: [css.Px] | [css.Px, css.Px] | [css.Px, css.Px, css.Px] | [css.Px, css.Px, css.Px, css.Px]) => css.ClayStyle
1 to 4 radii: top-left, top-right, bottom-right, bottom-left, as in CSS.
borderRadius
(10),
import csscss.const backdrop: (options?: css.BackdropOptions) => css.ClayStyle
A backdrop of the element: the content under it is blurred, then the element is drawn over it, so a translucent fill is glass over our own page (the desktop behind the window is out of reach). A renderer effect, not a Clay field, as `shadow` is: `header()` prints nothing for it and only a renderer that reads it draws one. The element needs an `id`. Today `cssints-native`'s `solid/` ThorVG renderer is the one that blurs.
backdrop
({ blur?: css.Px | undefined
The blur radius in pixels, as CSS's `backdrop-filter` reads one: about twice the gaussian's standard deviation. Not negative. Default: 12.
blur
: 10 }),
); import csscss.const backdrop: (options?: css.BackdropOptions) => css.ClayStyle
A backdrop of the element: the content under it is blurred, then the element is drawn over it, so a translucent fill is glass over our own page (the desktop behind the window is out of reach). A renderer effect, not a Clay field, as `shadow` is: `header()` prints nothing for it and only a renderer that reads it draws one. The element needs an `id`. Today `cssints-native`'s `solid/` ThorVG renderer is the one that blurs.
backdrop
({ spread: 2 }); // error: the box is the element's own
Object literal may only specify known properties, and 'spread' does not exist in type 'BackdropOptions'.
import csscss.const backdrop: (options?: css.BackdropOptions) => css.ClayStyle
A backdrop of the element: the content under it is blurred, then the element is drawn over it, so a translucent fill is glass over our own page (the desktop behind the window is out of reach). A renderer effect, not a Clay field, as `shadow` is: `header()` prints nothing for it and only a renderer that reads it draws one. The element needs an `id`. Today `cssints-native`'s `solid/` ThorVG renderer is the one that blurs.
backdrop
({ blur: "1rem" }); // error: a blur is pixels
Type '"1rem"' is not assignable to type 'Px | undefined'.
// no backdrop here either: the declaration keeps its layout and its translucent fill
static const Clay_ElementDeclaration menu = { .layout = { .sizing = { .width = { .size = { .minMax = { 150, 150 } }, .type = CLAY__SIZING_TYPE_FIXED } } }, .backgroundColor = { .r = 23, .g = 27, .b = 32, .a = 184 }, .cornerRadius = { .topLeft = 10, .topRight = 10, .bottomRight = 10, .bottomLeft = 10 } };
import * as import csscss from "cssints/clay" with { type: "cssints" };

// a card's fill: the panel token at the top, a step deeper at the bottom; `to right` would be 90deg
export const const card: css.ClayStylecard = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
import csscss.const width: (value: css.Size) => css.ClayStylewidth("100%"), import csscss.const bg: <readonly ["rgb(27 32 38)"]>(parts_0: "rgb(27 32 38)") => css.ClayStyle
`background-color`.
bg
("rgb(27 32 38)"),
import csscss.const backgroundImage: (gradient: string) => css.ClayStyle
A background image of the element, as CSS's `linear-gradient()` in one string: an optional direction (`<number>deg`, or `to top | to bottom | to left | to right`) and two or more colour stops with an optional `<number>%` each. Only a linear gradient is drawn. It is a renderer effect, not a Clay field, as `shadow` is: `header()` prints nothing for it and only a renderer that reads it draws one; the C targets keep their solid fill. `header()` and the C pages ignore it, the desktop renderer fills the element's box instead of `backgroundColor`, and the element needs an `id`.
backgroundImage
("linear-gradient(180deg, rgb(27 32 38), rgb(21 25 30))"),
); // a state overrides the whole gradient: the card lightens under the pointer export const const hovered: css.ClayStylehovered = import csscss.const cn: (...styles: css.ClayStyle[]) => css.ClayStyle
Merges styles in argument order: a later prop wins.
cn
(
const card: css.ClayStylecard, import csscss.const hover: (...styles: css.ClayStyle[]) => css.ClayStyle
Under the pointer: header() prints the style with it as `<name>_hover`. States do not nest.
hover
(import csscss.const backgroundImage: (gradient: string) => css.ClayStyle
A background image of the element, as CSS's `linear-gradient()` in one string: an optional direction (`<number>deg`, or `to top | to bottom | to left | to right`) and two or more colour stops with an optional `<number>%` each. Only a linear gradient is drawn. It is a renderer effect, not a Clay field, as `shadow` is: `header()` prints nothing for it and only a renderer that reads it draws one; the C targets keep their solid fill. `header()` and the C pages ignore it, the desktop renderer fills the element's box instead of `backgroundColor`, and the element needs an `id`.
backgroundImage
("linear-gradient(180deg, #2a303a, #1f242b)")),
); import csscss.const backgroundImage: (gradient: string) => css.ClayStyle
A background image of the element, as CSS's `linear-gradient()` in one string: an optional direction (`<number>deg`, or `to top | to bottom | to left | to right`) and two or more colour stops with an optional `<number>%` each. Only a linear gradient is drawn. It is a renderer effect, not a Clay field, as `shadow` is: `header()` prints nothing for it and only a renderer that reads it draws one; the C targets keep their solid fill. `header()` and the C pages ignore it, the desktop renderer fills the element's box instead of `backgroundColor`, and the element needs an `id`.
backgroundImage
({ angle: 180 }); // error: one string
Argument of type '{ angle: number; }' is not assignable to parameter of type 'string'.
import csscss.backgroundImage(); // error: the gradient is required
Expected 1 arguments, but got 0.
// no gradient here either: the declaration keeps its layout and its solid fill
static const Clay_ElementDeclaration card = { .layout = { .sizing = { .width = { .size = { .percent = 1 }, .type = CLAY__SIZING_TYPE_PERCENT } } }, .backgroundColor = { .r = 27, .g = 32, .b = 38, .a = 255 } };