Components
The components every family app shares. Plain CSS with an ob- prefix, plus a small JS module for the parts CSS can't do.
- Button
.ob-buttonPrimary 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.
- Field
.ob-fieldA label, a text input or select, and a message underneath. On a wrong answer the box shakes and the message turns into the error, then it clears after 3 seconds.
- Inline loading
.ob-inline-loadingA small spinner that turns into a tick when it's done, in the same spot, so the answer lands where the tap was. The tick is the theme's success colour.
- Spinner
.ob-spinner8 dots in a ring with a bright one running round. It's a line of text tall and takes the text colour.
- Loading text
.ob-loading-textA line that says what's happening while you wait, with a brighter band passing through it. Pair it with the spinner.
- Gradient text
.ob-gradient-textGold, with the light moving slowly across it. It's the same gold in every theme. Use it on 1 or 2 words a page.
- Confetti
.ob-confettiGold confetti that pops off a button, tumbles back down and settles on top of it. Each flake catches the light as it turns.
- Link
.ob-linkMuted text with a fine underline, and both take the accent on hover.
- Chip
.ob-chipOne of a row of options where one is on, like filters or a picker. Type comes from wherever it sits.
- Reveal
.ob-revealThings fading up as they scroll into view, a list arriving in order. If the script doesn't run, everything just shows.
- Stagger
.ob-staggerThe contents of something that's just opened, arriving one after another, like the lines in a tooltip or the rows in a menu.
- Badge
.ob-badgeA count on a button or tab, like unread messages. It pops in when there's something new and shrinks away at zero.
- Tooltip
.ob-tooltipA short label that shows on hover or keyboard focus, for icon buttons and anything else that needs a word of explanation.
Loading them
@import "obvious/css/components.css"; /* all of them */
@import "obvious/css/components/chip.css"; /* or one */They're my own code, written on the tokens. Every behaviour reads its timing from the component's custom properties, so retiming one is a CSS change.