Utilities.p
function · packages/mixins/src/utilities.ts:168
p(step: Space): StyleValuepadding on every side.
Mixins / foldkit-mixins/utilities
namespace · packages/mixins/src/utilities.ts:166
const Utilities = {
p,
px,
py,
m,
mx,
my,
gap,
text,
font,
leading,
rounded,
color,
bg,
items,
justify,
flex,
column,
grid,
block,
hidden,
wFull,
textCenter,
uppercase,
truncate,
srOnly,
scriptedOnly,
plainOnly,
pointer,
selectNone,
scrollFade,
scrollDivider,
scrollTimeline,
steady,
busyReveal,
}Utilities.pfunction · packages/mixins/src/utilities.ts:168
p(step: Space): StyleValuepadding on every side.
Utilities.pxfunction · packages/mixins/src/utilities.ts:170
px(step: Space): StyleValuepadding-inline.
Utilities.pyfunction · packages/mixins/src/utilities.ts:172
py(step: Space): StyleValuepadding-block.
Utilities.mfunction · packages/mixins/src/utilities.ts:174
m(step: Margin): StyleValuemargin on every side.
Utilities.mxfunction · packages/mixins/src/utilities.ts:176
mx(step: Margin): StyleValuemargin-inline; mx('auto') centers a block.
Utilities.myfunction · packages/mixins/src/utilities.ts:178
my(step: Margin): StyleValuemargin-block.
Utilities.gapfunction · packages/mixins/src/utilities.ts:180
gap(step: Space): StyleValuegap between flex or grid children.
Utilities.textfunction · packages/mixins/src/utilities.ts:182
text(size: keyof Tokens['size'] & string): StyleValuefont-size from the size scale.
Utilities.fontfunction · packages/mixins/src/utilities.ts:184
font(weight: keyof Tokens['weight'] & string): StyleValuefont-weight from the weight scale.
Utilities.leadingfunction · packages/mixins/src/utilities.ts:187
leading(name: keyof Tokens['leading'] & string): StyleValueline-height from the leading scale.
Utilities.roundedfunction · packages/mixins/src/utilities.ts:190
rounded(radius: keyof Tokens['radius'] & string): StyleValueborder-radius from the radius scale.
Utilities.colorfunction · packages/mixins/src/utilities.ts:193
color(name: ColorName): StyleValueText color from the palette.
Utilities.bgfunction · packages/mixins/src/utilities.ts:195
bg(name: ColorName): StyleValuebackground from the palette.
Utilities.itemsfunction · packages/mixins/src/utilities.ts:197
items(align: keyof typeof alignments): StyleValuealign-items of a flex or grid container.
Utilities.justifyfunction · packages/mixins/src/utilities.ts:199
justify(justify: keyof typeof justifications): StyleValuejustify-content of a flex or grid container.
Utilities.flexconst · packages/mixins/src/utilities.ts:201
flex: StyleValueUtilities.columnconst · packages/mixins/src/utilities.ts:203
column: StyleValueA flex column.
Utilities.gridconst · packages/mixins/src/utilities.ts:204
grid: StyleValueUtilities.blockconst · packages/mixins/src/utilities.ts:205
block: StyleValueUtilities.hiddenconst · packages/mixins/src/utilities.ts:206
hidden: StyleValueUtilities.wFullconst · packages/mixins/src/utilities.ts:207
wFull: StyleValueUtilities.textCenterconst · packages/mixins/src/utilities.ts:208
textCenter: StyleValueUtilities.uppercaseconst · packages/mixins/src/utilities.ts:209
uppercase: StyleValueUtilities.truncateconst · packages/mixins/src/utilities.ts:211
truncate: StyleValueOne line, cut with an ellipsis.
Utilities.srOnlyconst · packages/mixins/src/utilities.ts:213
srOnly: StyleValueVisually hidden but announced: screen-reader-only content.
Utilities.scriptedOnlyconst · packages/mixins/src/utilities.ts:229
scriptedOnly: StyleValueShown only where scripts run: a control a script drives, with a plain
stand-in beside it that plainOnly shows. Last in a slot's pieces, so it
wins over a width's display.
Utilities.plainOnlyfunction · packages/mixins/src/utilities.ts:231
plainOnly(display: string): StyleValueThe stand-in for a scriptedOnly control: not shown, and shown as display where no script runs.
Utilities.pointerconst · packages/mixins/src/utilities.ts:233
pointer: StyleValueUtilities.selectNoneconst · packages/mixins/src/utilities.ts:234
selectNone: StyleValueUtilities.scrollFadefunction · packages/mixins/src/utilities.ts:243
scrollFade(axis?: 'block' | 'inline'): StyleValueA scroller's content dissolving toward an edge with more to scroll, as
shadcn's scroll-fade: a mask whose two ends a scroll timeline moves, so
the true start and end stay crisp until something is past them. A browser
without scroll timelines (Firefox) gets no fade, since a still one would
sit on an edge with nothing beyond it. The gradient is physical, so in a
right-to-left page inline fades the left edge first.
Utilities.scrollDividerfunction · packages/mixins/src/utilities.ts:254
scrollDivider(axis?: 'block' | 'inline'): StyleValueA hairline at each edge of a scroller with more past it, as Fluid
Functionalism's scroll-divider: on a positioned parent of the scroller,
whose ::before and ::after it draws, because the fade's mask would
erase a line inside the scroller at the very edge it marks. The scroller
names its timeline with scrollTimeline(axis), and the parent borrows it
(timeline-scope), so a browser without that draws no line. Give a
parent one named scroller per axis: two make the name ambiguous, and an
ambiguous timeline draws no line.
Utilities.scrollTimelinefunction · packages/mixins/src/utilities.ts:256
scrollTimeline(axis?: 'block' | 'inline'): StyleValueNames a scroller's timeline for its parent's scrollDivider.
Utilities.steadyfunction · packages/mixins/src/utilities.ts:268
steady(weight: keyof Tokens['weight'] & string): StyleValueRoom for a label at weight, so it turns heavier (chosen, pressed)
without moving what is beside it. The element's data-label holds the
label's text, which a hidden ::after sets at that weight with no
height: a block as wide as its widest child takes the heavier width
whatever the label's own weight. The element stays a block container,
so a text-box trim on it still works; without data-label, nothing.
Hidden, the copy is no part of the element's accessible name: Chrome's
own accessibility tree names a steady button once. (Vitest's in-page
locator reads it twice, so a test presses such a button with click().)
Utilities.busyRevealconst · packages/mixins/src/utilities.ts:93
busyReveal: StyleValueBusy text said only once the wait is noticeable: on a status whose
aria-busy="true" marks a wait, it fades in after 0.6s, so a read that
answers sooner shows nothing where a "Loading…" drawn for a frame read as a
flash. The element itself always renders, so its space is held from the
start and nothing moves when the text shows; an answer in time removes
aria-busy before the delay ends, and the text never appears. Without
aria-busy it does nothing, so the same Slot can say "Nothing here."
plainly. The fade follows the motion knob, the delay does not.