If you like this project and want to help us, please give us a star ⭐️ on Github. ➡️ Star 🙏
View on GitHub

CSS variables

Use Bootstrap’s CSS custom properties for fast and forward-looking design and development.

CoreUI for Bootstrap includes around two dozen CSS custom properties (variables) in its compiled CSS, with dozens more on the way for improved customization on a per-component basis. These provide easy access to commonly used values like our theme colors, breakpoints, and primary font stacks when working in your browser’s inspector, a code sandbox, or general prototyping.

All our custom properties are prefixed with cui- to avoid conflicts with third party CSS.

Root variables

Here are the variables we include (note that the :root is required) that can be accessed anywhere Bootstrap’s CSS is loaded. They’re located in our _root.scss file and included in our compiled dist files.

:root {
  --cui-blue: #0d6efd;
  --cui-indigo: #6610f2;
  --cui-purple: #6f42c1;
  --cui-pink: #d63384;
  --cui-red: #dc3545;
  --cui-orange: #fd7e14;
  --cui-yellow: #ffc107;
  --cui-green: #198754;
  --cui-teal: #20c997;
  --cui-cyan: #0dcaf0;
  --cui-white: #fff;
  --cui-gray: #8a93a2;
  --cui-gray-dark: #636f83;
  --cui-primary: #321fdb;
  --cui-secondary: #9da5b1;
  --cui-success: #2eb85c;
  --cui-info: #39f;
  --cui-warning: #f9b115;
  --cui-danger: #e55353;
  --cui-light: #ebedef;
  --cui-dark: #4f5d73;
  --cui-breakpoint-xs: 0;
  --cui-breakpoint-sm: 576px;
  --cui-breakpoint-md: 768px;
  --cui-breakpoint-lg: 992px;
  --cui-breakpoint-xl: 1200px;
  --cui-breakpoint-xxl: 1400px;
  --cui-mobile-breakpoint: md;
  --cui-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --cui-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --cui-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
  --cui-body-color: rgba(44, 56, 74, 0.95);
}

Component variables

CoreUI allows you to customize components and create themes (only in CoreUI PRO) using custom properties as local variables for various components. This way we can reduce our compiled CSS, and allow restyling and extending of CoreUI components after Sass compilation.

Have a look at our variables list below. CoreUI supports mainly color variables, but we will add more variables in future releases.

Components

Accordion

--cui-accordion-bg
--cui-accordion-border-color
--cui-accordion-button-active-bg
--cui-accordion-button-active-color
--cui-accordion-button-active-icon
--cui-accordion-button-bg
--cui-accordion-button-color
--cui-accordion-button-focus-border-color
--cui-accordion-button-icon

Alerts

--cui-alert-bg
--cui-alert-border-color
--cui-alert-color
--cui-alert-link-color

Badges

--cui-badge-color
--cui-breadcrumb-active-color
--cui-breadcrumb-bg
--cui-breadcrumb-divider
--cui-breadcrumb-divider-color
--cui-breadcrumb-divider-flipped

Buttons

--cui-btn-active-bg
--cui-btn-active-border-color
--cui-btn-active-color
--cui-btn-bg
--cui-btn-border-color
--cui-btn-box-shadow
--cui-btn-color
--cui-btn-disabled-bg
--cui-btn-disabled-border-color
--cui-btn-disabled-color
--cui-btn-hover-bg
--cui-btn-hover-border-color
--cui-btn-hover-color
--cui-btn-link-color
--cui-btn-link-disabled-color
--cui-btn-link-hover-color
--cui-btn-shadow

Callout

--cui-callout-border-color
--cui-callout-border-left-color
--cui-callout-border-left-width
--cui-callout-border-width

Card

--cui-card-bg
--cui-card-border-color
--cui-card-cap-bg
--cui-card-cap-color
--cui-card-color

Close Button

--cui-btn-close-bg
--cui-btn-close-color
--cui-dropdown-bg
--cui-dropdown-border-color
--cui-dropdown-color
--cui-dropdown-dark-link-active-bg
--cui-dropdown-dark-link-hover-bg
--cui-dropdown-divider-bg
--cui-dropdown-header-color
--cui-dropdown-link-active-bg
--cui-dropdown-link-active-color
--cui-dropdown-link-color
--cui-dropdown-link-disabled-color
--cui-dropdown-link-hover-bg
--cui-dropdown-link-hover-color
--cui-position
--cui-footer-bg
--cui-footer-border-color
--cui-footer-border-width
--cui-footer-color
--cui-header-active-color
--cui-header-bg
--cui-header-border-color
--cui-header-border-width
--cui-header-brand-color
--cui-header-brand-hover-color
--cui-header-color
--cui-header-disabled-color
--cui-header-divider-border-color
--cui-header-divider-border-width
--cui-header-hover-color
--cui-header-toggler-bg
--cui-header-toggler-border-color
--cui-header-toggler-hover-icon-bg
--cui-header-toggler-icon-bg

List Group

--cui-list-group-action-active-bg
--cui-list-group-action-active-border-color
--cui-list-group-action-active-color
--cui-list-group-action-color
--cui-list-group-action-hover-color
--cui-list-group-active-bg
--cui-list-group-active-border-color
--cui-list-group-active-color
--cui-list-group-bg
--cui-list-group-border-color
--cui-list-group-color
--cui-list-group-disabled-bg
--cui-list-group-disabled-color
--cui-list-group-hover-bg
--cui-modal-backdrop-bg
--cui-modal-content-bg
--cui-modal-content-border-color
--cui-modal-content-color
--cui-modal-footer-border-color
--cui-modal-header-border-color
--cui-navbar-active-color
--cui-navbar-brand-color
--cui-navbar-brand-hover-color
--cui-navbar-color
--cui-navbar-disabled-color
--cui-navbar-hover-color
--cui-navbar-toggler-border-color
--cui-navbar-toggler-icon
--cui-scroll-height
--cui-nav-link-color
--cui-nav-link-disabled-color
--cui-nav-link-hover-color
--cui-nav-pills-link-active-bg
--cui-nav-pills-link-active-color
--cui-nav-tabs-border-color
--cui-nav-tabs-link-active-bg
--cui-nav-tabs-link-active-border-color
--cui-nav-tabs-link-active-color
--cui-nav-tabs-link-hover-border-color
--cui-nav-underline-border-color
--cui-nav-underline-link-active-border-color
--cui-nav-underline-link-active-color
--cui-nav-underline-link-color

Pagination

--cui-pagination-active-bg
--cui-pagination-active-border-color
--cui-pagination-active-color
--cui-pagination-bg
--cui-pagination-border-color
--cui-pagination-color
--cui-pagination-disabled-bg
--cui-pagination-disabled-border-color
--cui-pagination-disabled-color
--cui-pagination-focus-bg
--cui-pagination-focus-color
--cui-pagination-hover-bg
--cui-pagination-hover-border-color
--cui-pagination-hover-color

Popovers

--cui-popover-arrow-color
--cui-popover-arrow-outer-color
--cui-popover-bg
--cui-popover-body-color
--cui-popover-border-color
--cui-popover-header-bg
--cui-popover-header-border-color
--cui-popover-header-color

Progress

--cui-progress-bar-bg
--cui-progress-bar-color
--cui-progress-bg
--cui-is-mobile
--cui-sidebar-bg
--cui-sidebar-border-color
--cui-sidebar-border-width
--cui-sidebar-brand-bg
--cui-sidebar-brand-color
--cui-sidebar-color
--cui-sidebar-footer-bg
--cui-sidebar-header-bg
--cui-sidebar-nav-group-bg
--cui-sidebar-nav-group-indicator
--cui-sidebar-nav-group-indicator-hover
--cui-sidebar-nav-group-toggle-show-color
--cui-sidebar-nav-link-active-bg
--cui-sidebar-nav-link-active-color
--cui-sidebar-nav-link-active-icon-color
--cui-sidebar-nav-link-bg
--cui-sidebar-nav-link-color
--cui-sidebar-nav-link-disabled-color
--cui-sidebar-nav-link-disabled-icon-color
--cui-sidebar-nav-link-hover-bg
--cui-sidebar-nav-link-hover-color
--cui-sidebar-nav-link-hover-icon-color
--cui-sidebar-nav-link-icon-color
--cui-sidebar-nav-title-color
--cui-sidebar-occupy-end
--cui-sidebar-occupy-start
--cui-sidebar-toggler-bg
--cui-sidebar-toggler-hover-bg
--cui-sidebar-toggler-indicator
--cui-sidebar-toggler-indicator-hover
--cui-sidebar-width

Toasts

--cui-toast-background-color
--cui-toast-border-color
--cui-toast-color
--cui-toast-header-background-color
--cui-toast-header-border-color
--cui-toast-header-color

Tooltips

--cui-tooltip-arrow-color
--cui-tooltip-bg
--cui-tooltip-color

Forms

Checks and Radios

--cui-form-check-input-bg
--cui-form-check-input-checked-bg-color
--cui-form-check-input-checked-bg-image
--cui-form-check-input-checked-border-color
--cui-form-check-input-indeterminate-bg-color
--cui-form-check-input-indeterminate-bg-image
--cui-form-check-input-indeterminate-border-color
--cui-form-check-label-color
--cui-form-check-radio-checked-bg-image
--cui-form-switch-bg-image
--cui-form-switch-checked-bg-image
--cui-form-switch-focus-bg-image
--cui-gradient

Form Controls

--cui-form-file-button-bg
--cui-form-file-button-color
--cui-form-file-button-hover-bg
--cui-input-bg
--cui-input-border-color
--cui-input-color
--cui-input-disabled-bg
--cui-input-disabled-border-color
--cui-input-focus-bg
--cui-input-focus-border-color
--cui-input-focus-color
--cui-input-placeholder-color
--cui-input-plaintext-color

Input Group

--cui-input-group-addon-bg
--cui-input-group-addon-border-color
--cui-input-group-addon-color

Multi Select

--cui-form-multi-select-bg
--cui-form-multi-select-border-color
--cui-form-multi-select-cleaner-bg
--cui-form-multi-select-cleaner-border-color
--cui-form-multi-select-cleaner-focus-bg
--cui-form-multi-select-cleaner-hover-bg
--cui-form-multi-select-color
--cui-form-multi-select-disabled-bg
--cui-form-multi-select-disabled-color
--cui-form-multi-select-focus-bg
--cui-form-multi-select-focus-border-color
--cui-form-multi-select-focus-color
--cui-form-multi-select-option-disabled-color
--cui-form-multi-select-option-hover-bg
--cui-form-multi-select-option-hover-color
--cui-form-multi-select-option-indicator-bg
--cui-form-multi-select-option-indicator-border
--cui-form-multi-select-option-selected-bg
--cui-form-multi-select-option-selected-indicator-bg
--cui-form-multi-select-option-selected-indicator-bg-image
--cui-form-multi-select-option-selected-indicator-border-color
--cui-form-multi-select-options-bg
--cui-form-multi-select-options-border-color
--cui-form-multi-select-options-color
--cui-form-multi-select-search-bg
--cui-form-multi-select-search-color
--cui-form-multi-select-select-all-bg
--cui-form-multi-select-select-all-border-color
--cui-form-multi-select-select-all-color
--cui-form-multi-select-select-all-hover-bg
--cui-form-multi-select-select-all-hover-color
--cui-form-multi-select-tag-bg
--cui-form-multi-select-tag-border-color

Range

--cui-form-range-thumb-active-bg
--cui-form-range-thumb-bg
--cui-form-range-thumb-disabled-bg
--cui-form-range-track-bg

Select

--cui-form-select-bg
--cui-form-select-border-color
--cui-form-select-color
--cui-form-select-disabled-bg
--cui-form-select-disabled-border-color
--cui-form-select-disabled-color
--cui-form-select-focus-border-color

Examples

CSS variables offer similar flexibility to Sass’s variables, but without the need for compilation before being served to the browser. For example, here we’re resetting our page’s font and link styles with CSS variables.

body {
  font: 1rem/1.5 var(--cui-font-sans-serif);
}
a {
  color: var(--cui-blue);
}