Migrating to v5
Track and review changes to the CoreUI for Bootstrap source files, documentation, and components to help you migrate from v4 to v5.
v5.0.0
Sass
-
Breaking The
$*-basetheme color variables are removed. Set the theme colors directly:$primary-basebecomes$primary,$secondary-basebecomes$secondary, and so on forsuccess,info,warning,danger,lightanddark. The$primary-50and$primary-25shades (and the same for every theme color) are removed with no replacement. -
The default theme colors changed.
$primaryis now#5856d6(was#321fdb),$secondaryis#6b7785,$successis#1b9e3e, and$gray-baseis#323a49(was#3c4b64). Set the v4 values in Sass if your project must keep its look. -
Breaking
$text-high-emphasis,$text-medium-emphasis,$text-disabledand their-inverseforms are removed. Use$body-color,$body-secondary-colorand$body-tertiary-color. -
Breaking
$button-variants,$button-outline-ghost-variants,$alert-variantsand$list-group-variantsare removed, together with thebtn-color-map(),btn-outline-color-map(),alert-color-map()andvarify()functions. Buttons, alerts and list group items now loop over$theme-colors.
CSS variables
-
Per the color modes update, we’ve added
--cui-{color}-text-emphasis,--cui-{color}-bg-subtleand--cui-{color}-border-subtlefor our theme colors, plus the matching.text-{color}-emphasis,.bg-{color}-subtleand.border-{color}-subtleutilities. These new colors are available through Sass and CSS variables (but not our color maps) with the express goal of making it easier to customize across multiple colors modes like light and dark. -
--cui-btn-close-white-filteris replaced by--cui-btn-close-filter, which is set on:rootand switched by the color mode. -
--cui-border-widthis now being used in more components for greater control over default global styling. -
Removed duplicate root CSS variables.
Color modes
Learn more by reading the new color modes documentation.
-
Breaking The dark theme stylesheet is removed. v4 shipped dark mode as a separate stylesheet (
scss/themes/dark.scss, compiled todist/css/themes/dark.css) scoped to the.dark-themeclass. v5 builds dark mode intocoreui.css. Remove the import or the link tothemes/dark.css, and replace.dark-themewithdata-coreui-theme="dark".<!-- Previous markup --> <body class="dark-theme"> <!-- New markup --> <html lang="en" data-coreui-theme="dark"> -
Breaking Dark theme Sass variables move from the
-dtsuffix to the-darksuffix in the new_variables-dark.scss, for example$primary-dtto$primary-darkand$body-bg-dtto$body-bg-dark. A-dtvariable with no-darkcounterpart is removed. -
Global support for light (default) and dark color modes. Set color mode globally on the
:rootelement, on groups of elements and components with a wrapper class, or directly on components, withdata-coreui-theme="light|dark". Also included is a newcolor-mode()mixin that can output a ruleset with thedata-coreui-themeselector or a media query, depending on your preference. Set$color-mode-type: media-queryto follow the operating system setting.Deprecated Color modes replace dark variants for components, so
.btn-close-whiteand.navbar-darkare deprecated. -
We’ve expanded our theme color Sass variables, CSS variables, and utilities to include text emphasis, subtle background colors, and subtle border colors. These are available as Sass variables, CSS variables, and utilities.
-
Adds new
_variables-dark.scssstylesheet to house dark-mode specific overrides. This stylesheet should be imported immediately after the existing_variables.scssfile in your import stack.// Configuration @import "functions"; @import "variables"; +@import "variables-dark"; @import "maps"; @import "mixins"; @import "utilities"; -
Added Sass maps for generating theme colors for dark mode text, subtle background, and subtle border.
-
Added
color-scheme: darkto dark mode CSS to change OS level controls like scrollbars -
Form validation
border-colorand textcolorstates now respond to dark mode, thanks to new Sass and CSS variables.
Components
Alert
-
Breaking Alert variants are now built from the theme color variables. Each
.alert-{color}reads--cui-{color}-text-emphasis,--cui-{color}-bg-subtleand--cui-{color}-border-subtle, and the$alert-variantsmap is removed. -
Deprecated The
.alert-variant()mixin is still deprecated and will be removed in v6.0.0. We use a Sass loop directly to modify the component’s default CSS variables for each variant.
Calendar
-
Breaking A
.calendarelement is no longer started automatically on page load. Adddata-coreui-toggle="calendar"to the host element instead. The plugin adds the.calendarsclass to the host.<!-- Previous markup --> <div class="calendar" data-coreui-locale="en-US"></div> <!-- New markup --> <div data-coreui-toggle="calendar" data-coreui-locale="en-US"></div>
Close button
- Deprecated The
.btn-close-whiteclass has been deprecated and replaced withdata-coreui-theme="dark"on the close button or any parent element. See the docs for an example.
Date Picker
- Breaking Removed option
format, useinputDateFormatinstead of. It takes a function, so it can’t be set with adata-coreui-formatattribute. Pair it withinputDateParseto read typed dates. See the docs for an example. - Breaking In v4, setting
formatalso made the input read-only. SetinputReadOnly: trueto keep that behavior. - Breaking
dateChange.coreui.date-pickerevent return only the date object (event.date).event.formatedDateis removed. - Breaking The plugin builds new markup. The
.pickerwrapper becomes.date-picker-dropdown,.picker-input-groupbecomes.date-picker-input-group,.picker-input-group-indicatorbecomes.date-picker-indicator,.picker-input-group-cleanerbecomes.date-picker-cleaner,.date-picker-arrow-iconbecomes.date-picker-separator, and.picker-footerbecomes.date-picker-footer. Update custom CSS that targets the old classes.
Date Range Picker
- Breaking Removed option
format, useinputDateFormatinstead of. See the docs for an example. - Breaking
startDateChange.coreui.date-range-pickerandendDateChange.coreui.date-range-pickerevents return only the date object (event.date).event.formatedDateis removed.
List group
-
Breaking List group item variants are now built from the theme color variables. Each
.list-group-item-{color}reads--cui-{color}-text-emphasis,--cui-{color}-bg-subtleand--cui-{color}-border-subtle, and the$list-group-variantsmap is removed. -
Deprecated The
.list-group-item-variant()mixin is still deprecated and will be removed in v6.0.0. We use a Sass loop directly to modify the component’s default CSS variables for each variant.
Multi Select
- Breaking The
showN.coreui.multi-selectevent is renamed toshown.coreui.multi-select. - Breaking
.form-multi-select-selection-cleaneris renamed to.form-multi-select-cleaner.
Navbar
- Deprecated The
.navbar-darkclass has been deprecated and replaced withdata-coreui-theme="dark"on the navbar or any parent element. See the docs for updated examples.
Subheader
Subheader component has been removed.
Sidebar
- Breaking Sidebar has a light color scheme by default, use
.sidebar-darkto make it dark. The sidebar now takes its colors from--cui-body-bgand--cui-body-color..sidebar-lightand the$sidebar-light-*variables are removed. - Breaking
.sidebar-close,.sidebar-stickyand.sidebar-self-hiding{-breakpoint}are removed. - Breaking Renamed sidebar variables:
--cui-sidebar-nav-icon-width,-heightand-font-sizeare now--cui-sidebar-nav-link-icon-width,-heightand-font-size(Sass:$sidebar-nav-icon-*to$sidebar-nav-link-icon-*).--cui-sidebar-nav-group-indicatorand--cui-sidebar-nav-group-indicator-hoverare now--cui-sidebar-nav-group-indicator-iconand--cui-sidebar-nav-group-indicator-hover-icon.--cui-sidebar-toggler-indicator,-indicator-widthand-indicator-heightare now--cui-sidebar-toggler-icon,--cui-sidebar-toggler-widthand--cui-sidebar-toggler-height. The toggler icon is a mask, colored with--cui-sidebar-toggler-color.
- Breaking The
--cui-sidebar-header-*,--cui-sidebar-footer-*,--cui-sidebar-brand-height,--cui-sidebar-close-button-*,--cui-sidebar-border-width,--cui-sidebar-border-colorand--cui-sidebar-toggler-hover-bgvariables are removed.
Time Picker
- Breaking The plugin builds new markup. The
.pickerwrapper becomes.time-picker-dropdown,.picker-input-groupbecomes.time-picker-input-group,.picker-input-group-indicatorbecomes.time-picker-indicator,.picker-input-group-cleanerbecomes.time-picker-cleaner, and.picker-footerbecomes.time-picker-footer. Update custom CSS that targets the old classes.
Forms
.form-controlno longer reads the--cui-input-*and--cui-form-file-button-*CSS variables, except--cui-input-placeholder-color. Set the matching Sass variables ($input-bg,$input-color,$input-border-color,$form-file-button-bgand so on) instead.
Utilities
-
Deprecated
.text-mutedwill be replaced by.text-body-secondaryin v6.The
.text-mutedutility and$text-mutedSass variable stay deprecated in v5 and still map to--cui-secondary-color. They will be removed in v6.0.0. Use.text-body-secondaryand$body-secondary-color. -
Breaking
.elevation-6,.elevation-8,.elevation-9,.elevation-12,.elevation-16and.elevation-24are removed. The scale is now.elevation-0to.elevation-5, and.elevation-3and.elevation-4are deeper than before. -
Added new
.border-blackutility to match our.text-blackand.bg-blackutilities. -
Deprecated Deprecated the
.text-high-emphasisutility and$high-emphasisSass variable. -
Deprecated Deprecated the
.text-medium-emphasisutility and$medium-emphasisSass variable. -
Deprecated Deprecated the
.text-disabledutility and$disabledSass variable. -
Deprecated Deprecated the
.text-high-emphasis-inverseutility and$high-emphasis-inverseSass variable. -
Deprecated Deprecated the
.text-medium-emphasis-inverseutility and$medium-emphasis-inverseSass variable. -
Deprecated Deprecated the
.text-disabled-inverseutility and$disabled-inverseSass variable.