CSS
Joomla! 6
Joomla! 5
Joomla! 4
Template
Basic
Override Bootstrap 5 CSS Variables in a Joomla Child Template
Customizes Bootstrap 5 colors, typography and corner radii cleanly using :root CSS custom properties without recompiling SCSS.
media/templates/site/meu_tema/css/user.css
:root {
--bs-primary: #147A3C;
--bs-primary-rgb: 20, 122, 60;
--bs-body-color: #12171C;
--bs-body-bg: #FFFFFF;
--bs-border-color: #DCE2E8;
--bs-border-radius: 0px;
--bs-border-radius-sm: 0px;
--bs-border-radius-lg: 0px;
--bs-body-font-family: "IBM Plex Sans", system-ui, sans-serif;
--bs-font-monospace: "IBM Plex Mono", monospace;
}
Keep --bs-primary-rgb aligned with --bs-primary so opacity utilities work properly.
Technical explanation and best practices
Instead of scattering !important overrides or recompiling the entire Bootstrap bundle, declare your design tokens via standard --bs-* CSS variables inside user.css.