Mixins / API

foldkit-mixins/layout

foldkit-mixins/layout: layout pieces (stack, cluster, sidebar, …) as StyleValues. Each entry's rule text is the same for every caller: the rules read --fk-l-* custom properties with token fallbacks, and the options only write those properties inline. Ten stacks with ten gaps are one rule and ten inline variables. The pieces are unlayered; a page puts them in layouts with Layers.standard.in.

Two things a query cannot read from a variable are structural instead: split's breakpoint (a @container or @media query) and stack's split index (an :nth-child). Those are part of the rule text, so each distinct value is its own class.

Namespaces

Functions

autoGridA grid that fits as many minItemSize columns as the width allows.
centerContent centered inline with a maximum measure and gutters.
clusterItems that wrap onto new lines: tags, toolbar buttons, metadata.
frameA media frame with a fixed aspect ratio; an img or video child covers it.
padConsistent padding from the space tokens.
reelA horizontally scrolling row.
sidebarA sidebar beside content that wraps under it when the content would get less than contentMin. Flex math, no query, so it needs no containment.
splitTwo columns above a breakpoint, one below.
stackA vertical stack that owns its children's block rhythm.
switcherA row that becomes a stack when narrower than threshold. Flex math, no query.

Values

asideThe aside of a sidebar: composed by the child that is the sidebar. The other children are the content.
intrinsicA child of stack that keeps its intrinsic width instead of the stack's full-width default. The stack's child rule excludes this piece's class.

Interfaces