Dual POC — Layout Primitives & Grid

Every layout mechanism the POC ships, rendered live against dist/preset/full.css (the full barrel — variables + base + utilities + grid). Switch theme modes to see each primitive re-theme.

Theme mode (root class):

The 10 layout primitives

Flexbox/intrinsic, token-bound, container-query-free. Each re-themes with the mode switcher.

.Dual-Stack — vertical rhythm between siblings

Item
Item
Item
--dual-stack-space gap; modifiers --sm / --lg / --xl.

.Dual-Cluster — wrapping inline group

Tag
Longer tag
A
Another
B
Wraps + aligns; --between / --center justify modifiers.

.Dual-Sidebar — fixed side + fluid main, collapses (no media query)

Sidebar (16rem basis)
Main (fluid, min 50%)

.Dual-Switcher — row ↔ column at a threshold (no media query)

One
Two
Three
Flips to a column below --dual-switcher-threshold (30rem) — shrink the window to see it.

.Dual-Center — max-width content column (bound to a content-measure token)

Centered measure (--dual-size-content-medium, 68ch), auto side margins.

.Dual-Reel — horizontal scroll strip

1
2
3
4
5
Overflow-x scroll; children keep their width (scroll right →).

.Dual-Cover — vertical centering with header/footer room

Header
Centered principal
Footer

.Dual-Box — padded container with a token border (NEW — completes the set)

A padded box with a --dual-box-pad inset and a token border. Content sits inside the padding.

.Dual-Frame — aspect-ratio media box (NEW)

16 / 9 frame
Locks an aspect-ratio (--dual-frame-ratio); children cover-fit.

.Dual-Imposter — overlay/center on a positioned ancestor (NEW)

Positioned host
Imposter (centered overlay)

Grid modes

.FlexGrid — modern gap gutter + gap-aware calc() cells (flexbox)

1of3
1of3
1of3
1of2
1of2
No negative margins — the gutter is a real gap; cell widths subtract it via calc().

.CssGrid — CSS Grid, 12-col track + spans

span6
span6
span4
span4
span4
span12

.CssGrid--bento — dense auto-flow with hero/wide cells

hero (2×2)
a
b
wide (2)
c
d

.CssGrid--autoFit — intrinsic responsive, no media queries

auto
auto
auto
auto
repeat(auto-fit, minmax(16rem, 1fr)) — reflows on width alone.

Size scales & spacing escape hatch (NEW)

Content-measure caps (--dual-size-content-*, ch-based), fluid clamp() sizes (--dual-size-fluid-*), and the dual-space($n) multiplier for an arbitrary step off the --dual-spacing base.

content-small (55ch) reading measure
fluid-medium clamp() — resize the window
padding = dual-space(3) = calc(var(--dual-spacing) × 3)

Subtree theme via attribute (NEW — Q3 attribute-scoped modes)

The theme() mixin now emits both the root .dual-theme-* class and a [data-dual-theme="…"] attribute selector, so a subtree can switch mode independently of the page. The three panels below each carry their own data-dual-theme — the page mode does not touch them.

data-dual-theme="light"
action fill
data-dual-theme="dark"
action fill
data-dual-theme="sand"
action fill
Nestable: a panel keeps its mode even when the page switches. iris keeps its iris-ui-theme-* class names; this attribute form is the portable pattern.

Responsive tier — drag to resize

The --dual-layout-* tier + responsive typography shift per breakpoint (544 / 768 / 1024 / 1440 / 1920). Drag the frame's right edge; the readout shows the active breakpoint.

responsive cell
responsive cell
md-1of4
md-1of4
Frame width: — · active breakpoint: —

How the layers stack & combine

The layout system is four layers that compose — base (element defaults) + variables (the --dual-* vars everything reads) + utilities (u-* single-purpose classes) + grid/primitives (.FlexGrid/.CssGrid/.Dual-*). One realistic composition using all four at once — a card grid where each cell stacks content, spaced by utilities, themed by the variable layer:

Grid → Box → Stack CssGrid--autoFit lays the cells; Dual-Box pads; Dual-Stack spaces the children.
u-flex u-gap-sm
Utilities on top of grid A u-flexJustifyBetween row inside a grid cell — utilities handle the micro-layout the grid does not.
start end
Base type + variable layer Text uses the base element styles; every color reads the --dual-* variable layer, so this whole grid re-themes with the mode switcher above.
LayerProvidesCombines with
variables--dual-* values every other layer readsthe base of all three below
baseelement defaults (h1–h6, p, reset)sits under utilities + grid; no class needed
utilitiesu-flex, u-gap-*, u-flexJustify* — micro-layoutinside grid cells + primitives
grid / primitives.FlexGrid/.CssGrid macro-layout + .Dual-* primitivesnest freely (grid → box → stack → utilities)

See SCSS Structure for how these layers are authored, and CSS Overview for the whole POC.