Veylo Docs

HomeDocsLayout

Layout and utilities

Veylo has a small set of utility classes for spacing, flex and grid layout, and text. All of them are scoped to .veylo. They are bare words (flex, gap2), not prefixed, so they stay short in markup.

Flex and grid

ClassEffect
flex, grid, block, inline, noneSet display
wrapflex-wrap: wrap
colflex-direction: column
growflex: 1 1 auto; use on an input in a .row to fill the line
betweenjustify-content: space-between
items-calign-items: center
centerCentre on both axes
cols-2, cols-3, cols-4, cols-6Grid with that many equal columns (use with grid)
auto-fitResponsive grid: as many columns as fit, each at least 12rem
gap1, gap24px and 8px gap
clusterWrapping flex row, centred vertically, 8px gap. Best for button rows
stackFlex column with 8px gap
rowOne form line: flex, centred, 8px gap, wraps. A leading label gets a minimum width so fields line up

One

cols-3

Two

gap2

Three

grid
<div class="grid cols-3 gap2">
  <div class="veylo-card"><h4>One</h4><div>...</div></div>
  ...
</div>
<div class="cluster"><button>OK</button><button>Cancel</button></div>
<div class="row"><label for="n">Name</label><input id="n" class="grow"></div>

Spacing

ClassEffect
m0, mt0Remove all margin, or only the top margin
mt1, mt2Top margin 4px, 8px
mb1, mb2Bottom margin 4px, 8px

Text and surface helpers

ClassEffect
tl, tc, trText align left, centre, right
b, i, uBold, italic, underline
monoMonospace font
dimSecondary text colour (--text-dim)
smSmall text (on plain elements; on buttons and some components it also means the compact size)
clipSingle line with an ellipsis
noselDisable text selection
raise, sink, etchApply the bevel shadows to any element
face, field, accBackground colours: surface, input, accent (accent also sets white text)
bd1px border in the rule colour
w100width: 100%
fl, fr, clearFloat left, float right, clear

Showing and hiding

ClassEffect
hide, [hidden]Remove from layout (the hidden attribute always wins, even over flex)
srVisually hidden but available to screen readers
skipSkip link: hidden until focused, then shown at the top left

Page width

.veylo is centred with a maximum width of --measure (58rem) and 8px padding. For a full-width app, override it:

.veylo { max-width: none; margin: 0; }

.veylo-desk sets a page background from --desk if you want one without JavaScript. When printing, the width limit and the window shadow are removed.

Split panes

.veylo-split lays out panes side by side with draggable gutters. Add v for vertical. Split panes nest, and any number of panes works. Give the container a height.

Left pane. Drag the bar.
Top right
Bottom right
<div class="veylo-split" style="height:16rem">
  <div>Left</div>
  <div class="veylo-split v"><div>Top</div><div>Bottom</div></div>
</div>

The gutters are inserted for you. They take the keys in Keyboard and mouse. While dragging, the gutter and split get the drag class.

.veylo-layout is a two-column grid: a 12rem sidebar and a flexible content column. The docs you are reading use it. Put a ul.veylo-nav first (see Navigation), then one content element.

<div class="veylo-layout">
  <ul class="veylo-nav"><li><a href="#" class="on">Overview</a></li><li><a href="#">API</a></li></ul>
  <div>Content</div>
</div>

On narrow screens the layout collapses to one column.