@gridui/style-utils
v2.1.3
Published
GridUI React style utils
Readme
@gridui/style-utils
GridUI style utils. Part of the GridUI React monorepo.
Use cn from the package root to compose classes. Shared spacing types and
responsive calculations belong to the explicit @gridui/style-utils/responsive
entry:
import type { Responsive, Space } from "@gridui/style-utils/responsive";
import { resolveResponsive, spacingVariables, spaceValue } from "@gridui/style-utils/responsive";
const padding: Responsive<Space> = { base: 16, md: 24 };
const variables = spacingVariables("panel-padding", padding);
// --gridui-panel-padding: var(--gridui-space-16)
// --gridui-panel-padding-md: var(--gridui-space-24)
// --gridui-panel-padding-lg: var(--gridui-space-24)Responsive<T> accepts a scalar or { base, md?, lg? }. Missing breakpoints
inherit the preceding value; an explicit zero is preserved. Readonly string
arrays are scalar values, allowing Grid track lists to use the same resolver.
spaceValue encodes a spacing token reference, while spacingVariables returns
a plain CSS custom-property map with no React types or runtime dependency.
Import generic spacing types and helpers from this entry. Grid owns the separate column, track, span, and structural region contracts.
See the repository README for CSS setup, supported environments, development, and release requirements.
See quarterly release history for prepared release notes and consumption records.
