Buttons

The .button look is applied to <button>, <a class="button"> and <input type="submit|reset|button">. Use a <button> for an action, an <a> for navigation.

Go somewhere

Colours

A palette-family class recolours the button: .primary, .secondary, .success, .warning, .error, plus .soft (neutral). Add a family to $colors and its button variant is generated for free.

Modifiers need .button

The base look targets a bare <button> directly, so it needs no class. Every modifier below — colour, .outline / .ghost / .soft, the size classes, .expanded — targets .button / a.button specifically. Add .button alongside them even on a <button> element, or the modifier silently does nothing.

Modifiers

Button modifier classes
ClassEffect
.outline / .ghostBorder-only / text-only. Combine with a family.
.xsmall / .small / .largeChange the text size, and with it the em-based padding. .xsmall and .small tighten the padding further via --jf-button-scale-modifier (0.66 / 0.8); .large leaves it at 1, so the larger type does the work on its own.
.expandedFull width, block display.
:disabled / [disabled]Dims and blocks pointer events (native).

Lists and groups

  • .button-list — a wrapping row of buttons with even gap spacing.
  • .button-group — buttons fused into one segmented control (shared border, squared inner corners).

Overriding

  • One button / a scoped rule--jf-button-color-theme / -color-text and their -hover- pair; --jf-button-padding-x / -y; --jf-button-scale-modifier.
  • Everywhere — the Sass variables below. $buttons is the selector list every rule targets; $button-base-color sets the default family.

Variables

Colour

Button variables — Colour
NameDefaultNotes
$buttons.button, a.button, button, [type=submit], [type=reset], [type=button]The selector stack every button rule targets.
$button-base-colorprimaryPalette family for an unmodified button.
$button-hover-valuerole-shade(emphasis) (700)Shade a button moves to on hover / focus. Set 500 to drop the hover shift entirely — that also removes the .ghost underline treatment.

Size & typography

Button variables — Size & typography
NameDefaultNotes
$button-padding-x1.25emInline padding → --jf-button-padding-x. In em, so it tracks the button's font size.
$button-padding-y0.75emBlock padding → --jf-button-padding-y.
$button-font-sizetoken(font-size-base)Default text size.
$button-font-size-xsmalltoken(font-size-xs)Text size for .xsmall.
$button-font-size-smalltoken(font-size-sm)Text size for .small.
$button-font-size-largetoken(font-size-md)Text size for .large.
$button-font-familytoken(font-secondary)Button typeface.
$button-font-weightget-weight(bold)Button text weight.
$button-line-heightget-leading(snug)Button line height.
$button-text-transformnonetext-transform — set uppercase for a caps button.

Border & states

Button variables — Border & states
NameDefaultNotes
$button-border-radiustoken(radius-md)Corner radius. .button-group squares off the inner corners.
$button-border-widthtoken(border-width)Border width. The border is always solid and takes the button's theme colour, so it only reads on .outline.
$button-disabled-opacity0.65Opacity of a :disabled button.
$button-list-button-marginget-space(2xs)Half the .button-list gap — the gap is twice this.

Custom properties

Button variables — Custom properties
NameDefaultNotes
--jf-button-color-themethe family's 500Fill and border colour. Family / .soft modifiers repoint it; .outline and .ghost read it as the text colour instead.
--jf-button-color-textits --jf-color-on-*Text colour, contrast-picked against the fill.
--jf-button-hover-color-themethe family at $button-hover-valueFill and border on hover / focus. Not emitted when $button-hover-value is 500.
--jf-button-hover-color-textits --jf-color-on-*Text colour on hover / focus.
--jf-button-padding-x $button-padding-xInline padding, multiplied by the scale modifier below.
--jf-button-padding-y$button-padding-yBlock padding, multiplied by the scale modifier below.
--jf-button-scale-modifier1Multiplier applied to both paddings. .xsmall sets 0.66, .small 0.8, .large 1.