Time to update the navbar component

Already in bootstrap v5.2.0 the class navbar-light was deprecated and now in bootstrap v5.3 the class navbar-dark is deprecated. I think it’s about time to update the navbar component.

The new Theme tab in the options panel only handle light and dark color modes, it would be nice to be able to have custom color modes too.

2 Likes

Was about to make a forum post about this (The navbar-light class), since it caused a small issue when switching between light / dark mode after the newest update.

Turns out, I just had to play around with the Navbar Options for a moment to get it to work when using the Theme Switcher. Had to go to the Bootstrap Navbar Docs to see what was wrong, turns out it was because the Background needed to be set to Body Tertiary.

1 Like

Thank you for starting this thread! We will investigate ways to upgrade the navbars while maintaining backwards compatibility in case someone depends on the old navbar-light and dark classes. The recent Bootstrap 5 releases are unique in that they introduce breaking changes. If they released Bootstrap 6 instead of 5.3 this would have been avoided.

Supporting arbitrary color modes would be a lot of work and we are not sure how many people would use this in practice. We will wait for more request to come in before committing to it.

2 Likes

@martin

If there is an old value in localStorage e.g theme=blue the theme switcher doesn’t work and you get an error in the console in the function setActiveTheme trying to add a classList to null. The same goes if you have a what you call a forced theme.

Great catch! We will fix this in our next update.

2 Likes

Isn’t 5.3x still in Alpha?

Current stable version of Bootstrap is 5.3.0. The alpha is done

1 Like