Migration from Bootstrap

LombokCSS covers the same component surface as Bootstrap, so most migrations are a class rename plus dropping the Sass/JS bundle. This page maps the concepts and the classes.

Mental model differences

Three things change how you think:

  • Theming is runtime, not build-time. Bootstrap recompiles Sass variables; LombokCSS reads CSS custom properties, and a whole look is one data-style attribute — no build step to re-theme.
  • Utilities are first-class. Like Bootstrap 5 utilities, but you can also drop into a Tailwind-ish flow (flex items-center gap-4) without leaving the framework.
  • Less JavaScript. Accordions and modals are native (<details>, <dialog>); the optional 2 KB script only wires dropdowns, tabs, toasts, carousels, drawers and table sort.

Class map

BootstrapLombokCSSNotes
btn btn-primarybtn btn-primarySame. Variants: btn-secondary/outline/soft/ghost/link/danger.
btn-lg / btn-smbtn-lg / btn-smSame names.
btn-groupbtn-groupSame.
card / card-body / card-titlecard / card-body / card-titleSame; also card-header/footer/text.
badge bg-primarybadge badge-primaryPill: badge-pill.
alert alert-successalert alert-successSame.
form-controlinput / textareaOr go classless — bare inputs are styled.
form-selectselectSame idea.
form-check / form-check-inputcheck + native inputThemed via accent-color.
form-switchswitchMarkup differs slightly (see Forms).
is-invalid / invalid-feedbackis-invalid / error-textPlus native :user-invalid with zero JS.
input-group / input-group-textinput-group / input-addonSame concept.
navbar / navbar-nav / nav-linknavbar / navbar-nav + aMobile toggle: navbar-toggle.
nav nav-tabstabsUse ARIA role="tab".
accordionaccordion + <details>Native, no JS.
dropdown / dropdown-menu / dropdown-itemdropdown / dropdown-menu / dropdown-itemToggle via data-dropdown-toggle.
modal (+ JS)dialog.modal + modal-cardNative <dialog>; open with data-modal-open.
toastLombok.toast()JS helper creates the region.
offcanvasdrawer + drawer-overlaydata-drawer-open.
breadcrumb / paginationbreadcrumb / paginationSame.
list-group / list-group-itemlist-group / list-group-itemSame.
progress / progress-barprogress > .barWidth via inline inline-size.
spinner-borderspinnerSame idea.

Grid & layout

Replace the 12-column row/col grid with CSS grid utilities (or flex). It is terser and needs no .row wrapper.

col
col
col
<!-- Bootstrap -->
<div class="row">
  <div class="col-md-4">…</div>
  <div class="col-md-4">…</div>
  <div class="col-md-4">…</div>
</div>

<!-- LombokCSS -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-3">
  <div>…</div><div>…</div><div>…</div>
</div>

Theming

Drop the Sass pipeline. Override CSS variables instead, and pick a look with data-style.

// Bootstrap (build-time Sass)
$primary: #e11d48;
@import "bootstrap";

/* LombokCSS (runtime CSS variables) */
:root { --lc-accent:#e11d48; --lc-radius:4px; }
<html data-style="resonant-stark" data-theme="dark">

JavaScript

Bootstrap's data-bs-* attributes and JS plugins become small data-* hooks (or native elements):

<!-- Bootstrap -->
<button data-bs-toggle="modal" data-bs-target="#m">Open</button>

<!-- LombokCSS -->
<button data-modal-open="m">Open</button>
<dialog class="modal" id="m">…</dialog>

Step-by-step

  1. Swap the stylesheet/script links for lombok.min.css (+ optional lombok.js).
  2. Rename component classes using the table above (most are identical).
  3. Replace .row/.col-* with grid grid-cols-* / col-span-* or flex utilities.
  4. Convert data-bs-* triggers to the data-* hooks (modal, dropdown, drawer) or native elements.
  5. Move Sass variable overrides to CSS custom properties on :root; choose a data-style.
  6. Delete the Bootstrap + Popper bundles.

Gotchas

  • No jQuery/Popper. Tooltips/popovers are CSS/JS-light; positioning is simpler and may need tweaks for edge cases.
  • Utilities aren't 1:1. LombokCSS ships a focused utility set; check the Utilities page for exact names (e.g. spacing uses a token scale).
  • Logical properties. If you had LTR-only overrides using left/right, switch to inline-start/inline-end to keep RTL working.
  • Color modes. Dark mode is data-theme (or OS), not a separate stylesheet.