A site colour scheme with yf_bs_theme, the Bootstrap 5 runtime theme layer: pick colours, and the framework computes the hover, active and focus shades and the contrasting text colour the way Bootstrap's Sass does, as a small stylesheet of --bs-* variables over the base theme (here slate, the current theme). Every value passes yf_bs_theme::variables(), which keeps only #rgb / #rrggbb colours and rem / em / px lengths, so a request cannot inject CSS. Nothing is saved; the preview is scoped to the box below. Classes: yf_bs_theme, yf_common.
This page runs Bootstrap 3, which has no CSS variables: a site theme renders its base there. Switch to Bootstrap 5 to see the preview.
Project config for this theme
$PROJECT_CONF['bs_theme']['THEMES']['brand'] = array (
'base' => 'slate',
'primary' => '#0d6efd',
'body-bg' => '#ffffff',
'body-color' => '#212529',
'border-radius' => '0.375rem',
);
$CONF['DEF_BOOTSTRAP_THEME_USER'] = 'brand';Generated stylesheet
/* yf bs_theme v1 over slate */
:root, [data-bs-theme=light] {
--bs-primary: #0d6efd;
--bs-primary-rgb: 13,110,253;
--bs-primary-text-emphasis: #052c65;
--bs-primary-bg-subtle: #cfe2ff;
--bs-primary-border-subtle: #9ec5fe;
--bs-focus-ring-color: rgba(13,110,253,.25);
--bs-body-bg: #ffffff;
--bs-body-bg-rgb: 255,255,255;
--bs-body-color: #212529;
--bs-body-color-rgb: 33,37,41;
--bs-border-radius: 0.375rem;
}
.btn-primary {
--bs-btn-color: #ffffff;
--bs-btn-bg: #0d6efd;
--bs-btn-border-color: #0d6efd;
--bs-btn-hover-color: #ffffff;
--bs-btn-hover-bg: #0b5ed7;
--bs-btn-hover-border-color: #0a58ca;
--bs-btn-focus-shadow-rgb: 49,132,253;
--bs-btn-active-color: #ffffff;
--bs-btn-active-bg: #0a58ca;
--bs-btn-active-border-color: #0a53be;
--bs-btn-disabled-color: #ffffff;
--bs-btn-disabled-bg: #0d6efd;
--bs-btn-disabled-border-color: #0d6efd;
}
.btn-outline-primary {
--bs-btn-color: #0d6efd;
--bs-btn-border-color: #0d6efd;
--bs-btn-hover-color: #ffffff;
--bs-btn-hover-bg: #0d6efd;
--bs-btn-hover-border-color: #0d6efd;
--bs-btn-focus-shadow-rgb: 13,110,253;
--bs-btn-active-color: #ffffff;
--bs-btn-active-bg: #0d6efd;
--bs-btn-active-border-color: #0d6efd;
--bs-btn-disabled-color: #0d6efd;
--bs-btn-disabled-border-color: #0d6efd;
}
.text-bg-primary {
color: #ffffff!important;
}
.nav-pills {
--bs-nav-pills-link-active-bg: #0d6efd;
}
.pagination {
--bs-pagination-active-bg: #0d6efd;
--bs-pagination-active-border-color: #0d6efd;
--bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}
.dropdown-menu {
--bs-dropdown-link-active-bg: #0d6efd;
}
.list-group {
--bs-list-group-active-bg: #0d6efd;
--bs-list-group-active-border-color: #0d6efd;
}
.progress, .progress-stacked {
--bs-progress-bar-bg: #0d6efd;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
border-color: #86b7fe;
box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}
.form-check-input:checked, .form-check-input[type=checkbox]:indeterminate {
background-color: #0d6efd;
border-color: #0d6efd;
}
.form-range::-webkit-slider-thumb {
background-color: #0d6efd;
}
.form-range::-moz-range-thumb {
background-color: #0d6efd;
}