obvious v0.1.0

Button

Primary for the one thing you want people to press, secondary beside it, and ghost for quiet actions. Height follows the theme's density and the corners follow its radius.

Press Send to see it loading.

Markup

<button class="ob-button" type="button">Save changes</button>
<button class="ob-button ob-button--secondary" type="button">Cancel</button>
<button class="ob-button ob-button--ghost" type="button">Skip</button>
<button class="ob-button ob-button--icon" type="button" aria-label="Next"><svg>…</svg></button>

<!-- sizes -->
<button class="ob-button ob-button--sm">…</button>
<button class="ob-button ob-button--lg">…</button>

<!-- loading: the label keeps its space -->
<button class="ob-button" aria-busy="true">
  <span>Send</span>
  <span class="ob-inline-loading" data-state="active">…</span>
</button>

Notes

Every size is at least 44px tall so it's easy to tap. Use a real <button>, or an <a> when it goes somewhere. The inline loading inside only shows while aria-busy is true.

CSS

@import "obvious/css/components/button.css";

Knobs

Set any of these on the component, or an ancestor, to change it.

PropertyDefault
--ob-button-heightvar(--ds-control-height-md)
--ob-button-padvar(--ds-control-pad-x-md)
--ob-button-radiusvar(--ds-radius-md)
--ob-button-bgvar(--ds-color-accent)
--ob-button-bg-hovervar(--ds-color-accent-hover)
--ob-button-fgvar(--ds-color-accent-contrast)
--ob-button-bordertransparent