Button

Buttons carry the primary color by default. In the classless build every button, [type="button"], [type="submit"], [type="reset"] and [role="button"] gets the same treatment.

ClassDoes what
btnBase button
btn-primaryPrimary color fill (the default look)
btn-secondaryTransparent with a border
btn-ghostNo border, no fill
btn-neutralFills from the fallback color instead of the theme color
btn-disabledGreyscale, for elements without a disabled attribute

Basic

<button class="btn">Button</button>
<a href="#" class="btn">Link button</a>

Variants

<button class="btn btn-primary">Primary</button>
<button class="btn btn-secondary">Secondary</button>
<button class="btn btn-ghost">Ghost</button>
<button class="btn btn-neutral">Contrast</button>

Classless: the modifier classes are bare (<code>.primary</code>, <code>.contrast</code>) because they only apply to elements the theme already styles.

Disabled

<button class="btn" disabled>Disabled</button>
<button class="btn btn-disabled">Looks disabled</button>

Unstyling a button

<div class="prose">
  <p>Read more about <button class="semantic" style="text-decoration: underline">this topic</button>.</p>
</div>

.semantic unsets every style so a button can sit inside a sentence. It works in both builds.

Input buttons

<input type="submit" class="btn" value="Submit" />
<input type="reset" class="btn" value="Reset" />

Button-type inputs are styled as buttons in both builds. In 1.x the classless build also applied the text-field rules to them, so they stretched to the full width and carried a bottom margin.