Hover & focus
Small reactions for your own things: lift with a hard shadow, grow, dim, and focus rings that match Momo's components. Hover effects only happen with a mouse; people who ask their device for less motion get them without the movement.
Hover
<a class="box p-5 hover-lift link-reset" href="#">hover-lift</a>
<a class="box p-5 hover-grow link-reset" href="#">hover-grow</a>
<a class="box p-5 bg-violet hover-dim link-reset" href="#">hover-dim</a>Focus rings
Every Momo component already shows a ring for the keyboard. These are for your own things. Tab to each one:
focus-ring
focus-ring-inset (inside a scrolling box)
<div class="box p-4 focus-ring" tabindex="0">focus-ring</div>
<div class="box p-0 h-24 w-48 overflow-y-auto"><div class="p-4 focus-ring-inset" tabindex="0">focus-ring-inset (inside a scrolling box)</div></div>
<div class="box p-3 focus-within-ring hstack"><input class="form-control border-0" placeholder="focus-within-ring" aria-label="Search"><i class="mi mi-search text-muted" aria-hidden="true"></i></div>Classes
| Class | Does |
|---|---|
.hover-lift | Moves up and left 2px with a 3px hard shadow |
.hover-grow | Grows 2.5% |
.hover-dim | Fades to 80% |
.focus-ring | A 3px brand ring outside it on keyboard focus |
.focus-ring-inset | The same ring drawn inside the edge (not cut off by a scrolling box) |
.focus-within-ring | A ring around the whole box when anything inside has keyboard focus |