Borders & effects
Lines, corners, dividers, see-through and motion. Width, style and color combine: border-t border-2 border-violet border-dashed.
Lines
<div class="border p-4 rounded">border</div>
<div class="border-2 p-4 rounded">border-2</div>
<div class="border border-dashed p-4 rounded">border-dashed</div>
<div class="border-b-2 p-4">border-b-2</div>
<div class="border border-violet p-4 rounded">border-violet</div>
<div class="border border-soft p-4 rounded">border-soft</div>Dividers
divide-y draws a line between stacked children (lists, settings rows); divide-soft makes the lines faint.
- EmailOn
- PushOff
- Weekly digestOn
<ul class="divide-y divide-soft box p-0 max-w-sm">
<li class="flex justify-between px-4 py-3"><span>Email</span><span class="text-muted">On</span></li>
<li class="flex justify-between px-4 py-3"><span>Push</span><span class="text-muted">Off</span></li>
<li class="flex justify-between px-4 py-3"><span>Weekly digest</span><span class="text-muted">On</span></li>
</ul>Corners and shadows
The all-round corners (rounded-sm to rounded-full, rounded-0) and the shadows (shadow to shadow-2xl) are on Lines & shadows. Here: one side at a time.
<div class="box p-4 rounded-0 rounded-t-lg">rounded-0 rounded-t-lg</div>
<div class="box p-4 rounded-0 rounded-s-lg">rounded-0 rounded-s-lg</div>
<div class="box p-4 rounded-b-0">rounded-b-0</div>See-through and motion
<div class="box p-4 opacity-50">opacity-50</div>
<button class="btn btn-raise transition duration-300" type="button">transition duration-300</button>
<span class="mi mi-loader-2 animate-spin text-2xl" aria-hidden="true"></span>Transitions turn themselves (almost) off for people who ask their device for less motion, and animate-pulse stops.
animate-shake says "that was wrong" and animate-pop says "something arrived". Both play once: add the class when it happens, and take it off again so it can play the next time.
<div class="cluster">
<button class="btn" type="button" id="an-shake" onclick="this.classList.remove('animate-shake'); void this.offsetWidth; this.classList.add('animate-shake')">Shake me</button>
<button class="btn" type="button" onclick="var b = document.getElementById('an-pop'); b.textContent = +b.textContent + 1; b.classList.remove('animate-pop'); void b.offsetWidth; b.classList.add('animate-pop')">Add one <span class="badge-count" id="an-pop">3</span></button>
</div>Borders
| Class | CSS |
|---|---|
border | border-width: var(--momo-border-width); border-style: solid; border-color: var(--momo-line); |
border-t | border-block-start-width: var(--momo-border-width); border-block-start-style: solid; border-block-start-color: var(--momo-line); |
border-b | border-block-end-width: var(--momo-border-width); border-block-end-style: solid; border-block-end-color: var(--momo-line); |
border-s | border-inline-start-width: var(--momo-border-width); border-inline-start-style: solid; border-inline-start-color: var(--momo-line); |
border-e | border-inline-end-width: var(--momo-border-width); border-inline-end-style: solid; border-inline-end-color: var(--momo-line); |
border-x | border-inline-width: var(--momo-border-width); border-inline-style: solid; border-inline-color: var(--momo-line); |
border-y | border-block-width: var(--momo-border-width); border-block-style: solid; border-block-color: var(--momo-line); |
border-0 | border-width: 0; |
border-2 | border-width: 2px; border-style: solid; border-color: var(--momo-line); |
border-3 | border-width: 3px; border-style: solid; border-color: var(--momo-line); |
border-4 | border-width: 4px; border-style: solid; border-color: var(--momo-line); |
border-t-0 | border-block-start-width: 0; |
border-t-2 | border-block-start-width: 2px; border-block-start-style: solid; border-block-start-color: var(--momo-line); |
border-b-0 | border-block-end-width: 0; |
border-b-2 | border-block-end-width: 2px; border-block-end-style: solid; border-block-end-color: var(--momo-line); |
border-s-0 | border-inline-start-width: 0; |
border-s-2 | border-inline-start-width: 2px; border-inline-start-style: solid; border-inline-start-color: var(--momo-line); |
border-e-0 | border-inline-end-width: 0; |
border-e-2 | border-inline-end-width: 2px; border-inline-end-style: solid; border-inline-end-color: var(--momo-line); |
border-x-0 | border-inline-width: 0; |
border-x-2 | border-inline-width: 2px; border-inline-style: solid; border-inline-color: var(--momo-line); |
border-y-0 | border-block-width: 0; |
border-y-2 | border-block-width: 2px; border-block-style: solid; border-block-color: var(--momo-line); |
border-solid | border-style: solid; |
border-dashed | border-style: dashed; |
border-dotted | border-style: dotted; |
border-none | border-style: none; |
border-ink | border-color: var(--momo-line); |
border-soft | border-color: color-mix(in oklab, var(--momo-line) 18%, transparent); |
border-transparent | border-color: transparent; |
border-current | border-color: currentColor; |
divide-y | a line under every child but the last; |
divide-x | a line after every child but the last; |
divide-soft | makes those lines faint; |
Corners per side
| Class | CSS |
|---|---|
rounded-t | border-start-start-radius: var(--momo-radius); border-start-end-radius: var(--momo-radius); |
rounded-t-lg | border-start-start-radius: var(--momo-radius-lg); border-start-end-radius: var(--momo-radius-lg); |
rounded-t-0 | border-start-start-radius: 0; border-start-end-radius: 0; |
rounded-b | border-end-start-radius: var(--momo-radius); border-end-end-radius: var(--momo-radius); |
rounded-b-lg | border-end-start-radius: var(--momo-radius-lg); border-end-end-radius: var(--momo-radius-lg); |
rounded-b-0 | border-end-start-radius: 0; border-end-end-radius: 0; |
rounded-s | border-start-start-radius: var(--momo-radius); border-end-start-radius: var(--momo-radius); |
rounded-s-lg | border-start-start-radius: var(--momo-radius-lg); border-end-start-radius: var(--momo-radius-lg); |
rounded-s-0 | border-start-start-radius: 0; border-end-start-radius: 0; |
rounded-e | border-start-end-radius: var(--momo-radius); border-end-end-radius: var(--momo-radius); |
rounded-e-lg | border-start-end-radius: var(--momo-radius-lg); border-end-end-radius: var(--momo-radius-lg); |
rounded-e-0 | border-start-end-radius: 0; border-end-end-radius: 0; |
Opacity
| Class | CSS |
|---|---|
opacity-0 | opacity: 0; |
opacity-5 | opacity: 0.05; |
opacity-10 | opacity: 0.1; |
opacity-20 | opacity: 0.2; |
opacity-25 | opacity: 0.25; |
opacity-30 | opacity: 0.3; |
opacity-40 | opacity: 0.4; |
opacity-50 | opacity: 0.5; |
opacity-60 | opacity: 0.6; |
opacity-70 | opacity: 0.7; |
opacity-75 | opacity: 0.75; |
opacity-80 | opacity: 0.8; |
opacity-90 | opacity: 0.9; |
opacity-95 | opacity: 0.95; |
opacity-100 | opacity: 1; |
will-change-transform | will-change: transform; |
will-change-auto | will-change: auto; |
content-auto | content-visibility: auto; contain-intrinsic-size: auto 500px; |
Motion
| Class | CSS |
|---|---|
transition | transition-property: color, background-color, border-color, opacity, box-shadow, translate, scale, rotate, transform; transition-duration: var(--momo-speed); transition-timing-function: var(--momo-ease); |
transition-colors | transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-duration: var(--momo-speed); transition-timing-function: var(--momo-ease); |
transition-opacity | transition-property: opacity; transition-duration: var(--momo-speed); transition-timing-function: var(--momo-ease); |
transition-transform | transition-property: translate, scale, rotate, transform; transition-duration: var(--momo-speed); transition-timing-function: var(--momo-ease); |
transition-shadow | transition-property: box-shadow; transition-duration: var(--momo-speed); transition-timing-function: var(--momo-ease); |
transition-none | transition: none; |
duration-75 | transition-duration: 75ms; animation-duration: 75ms; |
duration-100 | transition-duration: 100ms; animation-duration: 100ms; |
duration-150 | transition-duration: 150ms; animation-duration: 150ms; |
duration-200 | transition-duration: 200ms; animation-duration: 200ms; |
duration-300 | transition-duration: 300ms; animation-duration: 300ms; |
duration-500 | transition-duration: 500ms; animation-duration: 500ms; |
duration-700 | transition-duration: 700ms; animation-duration: 700ms; |
duration-1000 | transition-duration: 1000ms; animation-duration: 1000ms; |
ease-linear | transition-timing-function: linear; |
ease-in | transition-timing-function: cubic-bezier(.4, 0, 1, 1); |
ease-out | transition-timing-function: cubic-bezier(0, 0, .2, 1); |
ease-in-out | transition-timing-function: cubic-bezier(.4, 0, .2, 1); |
ease-momo | transition-timing-function: var(--momo-ease); |
animate-spin | animation: momo-u-spin 1s linear infinite; |
animate-pulse | animation: momo-u-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; |
animate-none | animation: none; |
animate-shake | animation: momo-u-shake .35s var(--momo-ease); |
animate-pop | animation: momo-u-pop .3s var(--momo-ease); |
Backgrounds
Patterns that use the text color, so they work on any background and in dark mode: bg-dots, bg-grid, bg-lines. All nine patterns, with colors, are on Backgrounds.
<div class="box p-6 bg-dots w-40 text-center">bg-dots</div>
<div class="box p-6 bg-grid w-40 text-center">bg-grid</div>
<div class="box p-6 bg-lines w-40 text-center">bg-lines</div>| Class | CSS |
|---|---|
bg-none | background-image: none; |
bg-cover | background-size: cover; |
bg-contain | background-size: contain; |
bg-auto | background-size: auto; |
bg-center | background-position: center; |
bg-top | background-position: top; |
bg-bottom | background-position: bottom; |
bg-no-repeat | background-repeat: no-repeat; |
bg-fixed | background-attachment: fixed; |