Style helpers
Generated by
website/scripts/generate-api.tsfrompackages/gridla/src. Do not edit by hand; runbun run generateinwebsite/.
The inline geometry every adapter puts on items, preview outlines, and built-in resize handles. resizeHandleStyle reads the --gridla-handle-size, --gridla-handle-inset, and --gridla-handle-cursor custom properties so stylesheets can restyle handles; see the styling guide.
Functions
rectStyle
Inline styles that place an element at rect inside a canvas: with a
transform (default, keeps layout work off the main thread during
gestures) or with left/top ('absolute'). Lengths are px strings.
resizeHandleStyle
Inline styles for a built-in resize handle on edge. Handles sit fully
inside the item so they stay hit-testable when the item clips its overflow:
corner handles are size squares in the corners, edge handles run along
the side and stop inset short of each corner.
The geometry reads three custom properties, each with a fallback, so
plain CSS on [data-gridla-resize-handle] (or the handle class) restyles
them without fighting the inline declaration:
--gridla-handle-size: thickness (default10px).--gridla-handle-inset: corner clearance of edge handles (default: the size).--gridla-handle-cursor-\<edge\>or--gridla-handle-cursor: the cursor (default: the matching*-resizecursor).
Every adapter's built-in handles use this; call it yourself when you render handles by hand and want the same geometry.
styleToText
Serialize a style object with camelCase keys to a style attribute value.
Types
GridRectStyle
Inline geometry that places an element at a rect inside a canvas.
GridResizeHandleStyle
Inline geometry of a built-in resize handle. Every length is a CSS string
that reads a --gridla-handle-* custom property with a fallback, so a
stylesheet can restyle the handles without !important.
GridResizeHandleStyleOptions
Fallback values of resizeHandleStyle, used when the custom properties are unset.