Veylo Docs

HomeDocsButtons

Buttons

Every button, input[type=button|submit|reset] and a.veylo-btn inside .veylo is a raised Win98 button. Pressing it shows the sunken state, and keyboard focus draws the dotted ring. Buttons have a 75px minimum width.

Colour variants

ClassUse
(none)Normal action
primaryMain action, filled with --acc
secondaryBold label with a dark frame, still the face colour
success, danger, warning, info, darkFilled semantic colours
defDefault button of a dialog: gets a black frame, and Enter triggers it

In the classic theme, filled variants turn grey, as buttons did in Windows 98. Primary keeps the black default-button frame, and the other variants only tint their label.

Styles and sizes

ClassEffect
outlineField background with a thin border, no bevel
flatNo background or bevel until hovered or pressed
linkLooks like a link but behaves like a button
smCompact: smaller text and padding, no minimum width
lgLarger padding and text
iconSquare 23 by 22px button for a single glyph
blockFull width
onToggled-down state (dithered face); toggle it yourself in script
disabled attribute, .disGreyed label with a light ghost shadow; the cursor shows a no-entry sign
<button class="primary">Save</button>
<button class="danger sm">Delete</button>
<button class="icon" aria-label="Help">?</button>
<a class="veylo-btn" href="/next">Link button</a>
<button class="block">Full width</button>

Close button

button.veylo-x (also .veylo-chip button and button.x) draws its own cross with CSS, so it stays centred and readable when disabled. Always give it an aria-label. With veylo.js, add data-veylo-dismiss to hide the note, toast or chip it sits in. Add sm for a smaller one.

Saved. Click the cross to dismiss.
Locked: the cross is disabled.
<div class="veylo-note ok">
  <button class="veylo-x sm" data-veylo-dismiss aria-label="Close"></button>Saved.
</div>

Segmented control

<div class="veylo-seg"><button class="on">Day</button><button>Week</button><button>Month</button></div>

A joined group of buttons where .on marks the selected one. Left, Right, Home and End move the selection. Switching .on is up to your script; listen for clicks on the buttons.

details.veylo-dd.btn makes the summary look like a button. See Overlays and menus for the menu itself.

Switch

<label class="veylo-switch"><input type="checkbox" checked>Notifications</label>
<label class="veylo-switch sm"><input type="checkbox">Small</label>

A real checkbox drawn as a sliding switch, so it submits with forms and works with the keyboard (Space). The regular size prints ON or OFF inside the track; sm hides the text.