Type scale, weight, alignment & transforms — each example followed by its code.
<div class="text-xxl fw-bold lh-heading">Heading XXL</div>
<div class="text-xl fw-semibold lh-heading">Heading XL</div>
<div class="text-lg fw-medium lh-heading">Heading LG</div>
<div class="text-base">Body Base</div>
<div class="text-sm text-muted">Small muted text</div>
<div class="text-xs text-uppercase">Extra small uppercase</div>
<div class="text-left">Left aligned</div>
<div class="text-center">Center aligned</div>
<div class="text-right">Right aligned</div>
<div class="fw-light">Light</div>
<div class="fw-normal">Normal</div>
<div class="fw-semibold">Semibold</div>
<div class="fw-bold text-uppercase">Uppercase bold</div>
<div class="text-underline">Underline</div>
<div class="text-line-through">Line-through</div>
<div class="text-no-decoration">No decoration</div>
Text, background, border & spinner colors.
<div class="text-primary">Primary</div>
<div class="text-success">Success</div>
<div class="text-danger">Danger</div>
<div class="text-info">Info</div>
<div class="text-gray">Gray</div>
<div class="text-muted">Muted</div>
<div class="p-2 bg-primary text-white rounded-sm">Primary</div>
<div class="p-2 bg-success text-white rounded-sm">Success</div>
<div class="p-2 bg-warning rounded-sm">Warning</div>
<div class="p-2 bg-danger text-white rounded-sm">Danger</div>
<div class="p-2 border border-primary rounded-sm">Primary</div>
<div class="p-2 border border-success rounded-sm">Success</div>
<div class="p-2 border border-danger rounded-sm">Danger</div>
<span class="spinner spinner-primary"></span>
<span class="spinner spinner-success"></span>
<span class="spinner spinner-danger"></span>
<span class="spinner spinner-info"></span>
Margin/padding utilities and width/height tokens.
<div class="m-1 p-2">...</div>
<div class="mx-2 my-1 p-3">...</div>
<div class="px-4 py-2">...</div>
<div class="pt-5 pb-1">...</div>
<div class="w-25">...</div>
<div class="w-50">...</div>
<div class="w-75">...</div>
<div class="w-100">...</div>
<div class="wpx-64">...</div>
<div class="wrem-4">...</div>
<div class="wvw-25">...</div>
<div class="hvh-25">...</div>
Containers, flex row/cols, and CSS grid helpers.
<div class="container-narrow">...</div>
<div class="container-wide">...</div>
<div class="row">
<div class="col-4">...</div>
<div class="col-4">...</div>
<div class="col-4">...</div>
</div>
<div class="grid grid-cols-3 gap-2">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
Use .flex-*, .items-*, and .justify-* to control layout.
<div class="flex items-center justify-center">...</div>
<div class="flex items-start justify-between">...</div>
<div class="flex-column items-center">...</div>
Span columns/rows and reorder visually when needed.
<div class="grid grid-cols-4">
<div>1</div>
<div style="grid-column: span 2;">2</div>
<div>3</div>
<div style="grid-column: 1 / -1;">4</div>
</div>
Use flex for 1-dimensional alignment; use grid for true 2-D layouts.
<div class="flex items-center justify-between">...</div>
<div class="grid grid-auto-fit-md gap-2">...</div>
Border widths, corner radii, and shadow levels.
<div class="border rounded-sm">...</div>
<div class="border-2 rounded-lg">...</div>
<div class="border-3 rounded-xl">...</div>
<article class="card">...</article>
<article class="card card-shadow-4">...</article>
<article class="card shadow-none">...</article>
Shared blueprint, sizes, and variants.
<input class="input input-sm" placeholder="Small" />
<input class="input input-md" placeholder="Medium" />
<input class="input input-lg" placeholder="Large" />
<input class="input input-xl" placeholder="XL" />
<button class="btn btn-sm btn-primary">Primary</button>
<button class="btn btn-md btn-success">Success</button>
<button class="btn btn-lg btn-outline-danger">Outline Danger</button>
<button class="btn btn-xl btn-ghost-info">Ghost Info</button>
<button class="btn btn-md" disabled>Disabled</button>
Contextual feedback banners.
<div class="alert">Base alert</div>
<div class="alert alert-primary">Primary alert</div>
<div class="alert alert-success">Success alert</div>
<div class="alert alert-warning">Warning alert</div>
<div class="alert alert-danger">Danger alert</div>
<div class="alert alert-info">Info alert</div>
Surface container with border/shadow variants.
<article class="card">...</article>
<article class="card card-border-primary">...</article>
<article class="card card-shadow-4">...</article>
Each tab points to a content panel by href="#panel-id".
The JS shows the matching panel and hides the others.
<div class="tabs">
<a class="tab active" href="#tab-panel-1">One</a>
<a class="tab" href="#tab-panel-2">Two</a>
<a class="tab" href="#tab-panel-3">Three</a>
</div>
<div class="stack-2 mt-2">
<div class="tab-panel card p-2" id="tab-panel-1">Content for tab one.</div>
<div class="tab-panel card p-2" id="tab-panel-2" hidden>Content for tab two.</div>
<div class="tab-panel card p-2" id="tab-panel-3" hidden>Content for tab three.</div>
</div>
href matches a panel’s id.hidden..tabs, .tab, .tab-panel.
Click the button to open a modal. Close it by clicking the overlay or the ✕ button.
Works with the class-based JS you added (looks for .modal-open, .modal__overlay, .modal__close).
<button class="btn btn-md btn-primary modal-open" href="#demoModal">Open demo modal</button>
<div class="modal" id="demoModal" aria-hidden="true" role="dialog" aria-modal="true">
<div class="modal__overlay"></div>
<div class="modal__dialog" role="document">
<div class="modal__header">
<h3 class="modal__title">Demo modal</h3>
<button class="modal__close" aria-label="Close">✕</button>
</div>
<div>
<p>Put your content here.</p>
<div class="flex items-center gap-2">
<input class="input input-md" placeholder="Your name" />
<button class="btn btn-md btn-success">Save</button>
</div>
</div>
</div>
</div>
.modal-open on a button/link. Use href="#modalId" or data-target="#modalId"..modal__close to a button or click the .modal__overlay.id and the content — keep the classes the same.Motion, overflow, ratio, cursors & opacity.
<div class="hover-raise">...</div>
<div class="hover-glow">...</div>
<div class="truncate w-50">Long long text...</div>
<div class="opacity-50">...</div>
<div class="cursor-not-allowed">...</div>
<div class="overflow-scroll">...</div>
<div class="ratio ratio-16x9"><img class="object-cover" ... /></div>
<div class="ratio ratio-1x1"><img class="object-contain" ... /></div>
<div class="blur-sm">...</div>
Lightweight utilities used across the docs and components. Keep logic simple and colocated. This card describes the functions and expected usage; copy snippets as needed.
Post JSON-ish data via FormData to the PHP handler.
Builds a FormData payload and POSTs to /rss/php/handler.php, returning JSON.
// Example
const res = await _post(
{ name: 'Ada', roles: ['admin','editor'] },
'users',
'create'
);
// res → parsed JSON (or { ok:false, error:"..." } on failure)
Converts plain objects/arrays into FormData and appends target/function.
// Example
const fd = await createFormData({ tags: ['a','b'], avatar: file }, 'profile', 'update');
Small helpers to create elements and IDs.
Create an element, add classes, text, and data-* attributes.
// Example
const btn = createEl('button', ['btn','btn-md','btn-primary'], 'Save', { action: 'save' });
document.body.append(btn);
Generates a unique id (uses crypto.randomUUID() if available).
// Example
const id = getRandomID(); // "c1c0f33a-..." or base36 fallback
Create and remove framework-styled alerts using .alert and .alert-{color}.
Types align with your color tokens: primary, success, warning, danger, info, etc.
// Create and insert
const alertEl = await generateAlert('warning', 'Heads up!', { withClose: true, dismissAfter: 4000 });
document.querySelector('#alertHost').append(alertEl);
// Common types
await generateAlert('success', 'Saved!');
await generateAlert('danger', 'Something went wrong', { role: 'alert' });
Remove all alerts in scope (default: document).
// Example
removeAlert(); // or removeAlert(document.querySelector('#alertHost'));