إنتقل إلى المحتوى الرئيسي

Layout

Pages are composed from a few primitives (css/layout.css), all written with logical properties, so they mirror with dir without extra rules.

ClassDoes
.al-pageThe content column: centred, capped at --al-size-page, with the fluid gutter
.al-sectionA website section: fluid space above and below; a hairline between two
.al-eyebrowA few words above a section's heading, in the accent, saying which part this is; .al-eyebrow__index numbers it ("01"). With the heading in an <hgroup class="al-section__head">. Sentence case, never capitals
.al-stackChildren one under another, spaced by --al-stack-gap (--tight, --loose)
.al-clusterChildren in a wrapping row (--end, --between)
.al-gridAs many columns of at least --al-grid-min (16rem) as fit
.al-splitA narrow column beside a wide one; stacked under md
.al-measureCaps a block at the reading width
.al-shellThe app shell: sidebar and main; data-sidebar="collapsed"

Rules​

  • Gap, not margin. Components have no outer margin; their container spaces them. That's what keeps components reusable.
  • Reflow, don't break. Content works from 320px wide (WCAG 1.4.10) with no horizontal page scroll. A wide table scrolls inside its own region (.al-table-wrap), never the page.
  • Logical properties only. margin-inline-start, inset-inline-end, padding-block, text-align: start. Never left, right, margin-left or float: left. The one exception is a value axis on a chart, which stays put.
  • Text drives size. Sizes are in rem so the layout follows the reader's font size; containers grow with their content rather than clipping it.
  • The primary action is never folded away. Progressive disclosure hides detail, not the thing the page is for.