Skip to content

Layout

phil/ux-css

The layout classes say what the element is. They hold no colour and read their gaps from tokens, each through a custom property of its own that a site sets on one element.

ClassWhat it isIts custom properties
isStackA column of children with the same gap, their margins removed--phil-stack-gap (md)
isClusterA row that wraps, the same gap both ways, centred on the cross axis--phil-cluster-gap (sm)
isGridAs many columns as fit, each at least the minimum wide--phil-grid-min (--phil-panel-sm), --phil-grid-gap (md)
isCenterA block centred in its container, no wider than a readable line--phil-center-measure, --phil-center-gutter
isNarrowNo wider than the narrow measure, 36ch--phil-center-measure
isSplitTwo columns from 48rem, stacked below, the first child first--phil-split-gap (0)
isFullHeightAt least the height of the screen, 100dvh
isCoverA column with padding; its isCoverBody child takes the space left and centres its content--phil-cover-gap, --phil-cover-padding
isBleedMedia that fills its cell, the image covering the box; 40 % of the screen's height below 48rem--phil-bleed-min-size
hasEntranceOn an isBleed: enters with a slanted clip from 48rem, never under reduced motion

A split page

<div class="isSplit isFullHeight">
    <div class="isCover">
        <header><a href="/" class="isLogo"><img src="/logo.svg" alt="Studio"></a></header>
        <main class="isCoverBody">
            <div class="isNarrow">…</div>
        </main>
    </div>
    <figure class="isBleed hasEntrance">
        <picture>
            <source type="image/webp" srcset="/images/main.webp">
            <img src="/images/main.png" alt="">
        </picture>
    </figure>
</div>