Design system Foundations

Layout

How the Malkai workspace uses margins, columns and content regions across desktop and mobile.

.mk-stack.mk-cluster.mk-split.mk-grid

The frame

Layout begins with two fixed edges and one flexible canvas. On desktop, navigation owns the left edge and the page uses the remaining width. On mobile, navigation moves to the bottom and the page becomes one continuous reading order. The coloured guides below reveal the geometry; they are not product surfaces.

Page margin Alignment column Content region
Desktop12-column guide · 32px margins
Mobile4-column guide · 16px margins
Margins keep the page off the edge32px on tablet and desktop; 16px below 768px.
Columns align, gutters separateColumns are guides, not card counts. The 16px gaps stay visible between regions.
Content chooses a spanA region may use 12, split 8 + 4, or repeat 4 + 4 + 4. On mobile every region spans all four.

Spacing scale

A 4px base produces seven named steps. Page margins, region gaps and component spacing use this shared scale so layouts keep a consistent rhythm instead of introducing one-off values.

--mk-space-14px
--mk-space-28px
--mk-space-312px
--mk-space-416px
--mk-space-524px
--mk-space-632px
--mk-space-748px

Responsive grid

The grid changes at the same boundaries as the product. It adds alignment opportunities as space appears; it never makes existing content smaller just to preserve a column count.

Compact · 320–767

4 columns · 16px margins · one content region at a time.

Medium · 768–1023

8 columns · 32px margins · two regions when both remain useful.

Expanded · 1024+

12 columns · 32px margins · the canvas caps at 1600px.

  • The 1600px cap belongs to the canvasIt is room for operational UI — tables, timelines and parallel work — not a target line length for prose.
  • Text keeps its own measureLong-form copy should normally occupy 5–7 desktop columns, even when its section spans the full canvas.
  • Gutters stay emptyBackgrounds may span regions; text, icons and controls align to column edges and do not sit in the 16px gap.

Distribute content by job

Choose spans from the work the page must support. These are the three default desktop compositions. On mobile, every one becomes a single four-column sequence in HTML order.

Primary work · 12

One work surface

Queues, dense tables, builders and timelines that benefit from width.

Primary · 8Support · 4

Primary + support

The main task remains dominant; context or totals stay visible beside it.

A · 4B · 4C · 4

Peer regions

Three equally important summaries or cards, never a main task with two disguised asides.

  • Width follows importanceThe primary task gets the widest span. A narrow panel is supporting by definition.
  • One region, one jobIf two areas have different actions or update at different times, they are separate regions and usually separate widgets.
  • Do not fill space for symmetryEmpty columns are allowed. Stretching a form or paragraph across the canvas only creates longer eye travel.

Responsive reflow

The same three regions change arrangement below 768px. Desktop uses width to keep the primary task and its supporting context visible together. Mobile keeps their priority but turns the layout into one vertical sequence. The numbered regions make the preserved reading order explicit.

Desktop12-column composition
1Page header 2Primary work · 8 columns 3Supporting context · 4 columns
Below 768px
Mobileone reading sequence
1Page header 2Primary work 3Supporting context
  • What changesPosition and span: the 8 + 4 desktop pair becomes two full-width mobile regions.
  • What staysPriority, content, and HTML order: 1 → 2 → 3 at every width.
  • NavigationThe desktop rail becomes the product tab bar at the bottom; it does not enter the content sequence.

Layout primitives

These classes arrange related content inside a region. Choose the primitive that matches the relationship between its children.

Vertical rhythm

.mk-stack

Related items read from top to bottom. The modifier chooses their spacing.

Wrapping row

.mk-cluster

Whole chips, facts or controls wrap when the row runs out of room.

Two-ended row

.mk-split

A title and action, or label and value. It stacks below 520px.

Responsive field

.mk-grid

Cards repeat while their minimum width still fits; the container decides the count.

Rules that keep layout usable

  • Align related edgesPage titles, section titles and the first object in a region begin on the same column line.
  • Reflow before content becomes crampedRows wrap whole items, splits stack, and grids reduce their column count before text or controls become unreadable.
  • Preserve the HTML reading orderThe sequence in the page markup must remain logical for keyboard and screen-reader users at every width, even when columns move visually.
  • Let zoom collapse the layoutRegions reflow instead of forcing horizontal page scroll.
  • Do not rely on colour aloneDiagrams also name margins, columns and content regions in text.

Markup

<main class="page">
  <header>…12 columns…</header>

  <div class="mk-grid" style="--mk-grid-min: 320px">
    <section class="mk-widget">…primary work…</section>
    <aside class="mk-widget">…support…</aside>
  </div>
</main>

The page frame owns max-width:var(--mk-content-max) and padding-inline:var(--mk-page-pad). Inside it, use the named layout primitive or a documented composite; do not recreate the same geometry per page.