Closed (fixed)
Project:
BS Base
Version:
2.0.x-dev
Component:
BS Bootstrap
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Oct 2018 at 12:54 UTC
Updated:
13 Feb 2026 at 11:04 UTC
Jump to comment: Most recent
We are using jasny/bootstrap offcanvas (custom port to Bootstrap 4.x) for offcanvas navigation. That is not ideal. Also official jasny/bootstrap is slow to port to Bootstrap 4.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pivica commentedJasny Bootstrap released Bootstrap 4 compatible version https://github.com/jasny/bootstrap/releases/tag/v4.0.0.
Comment #3
pivica commentedComment #4
pivica commentedComment #5
pivica commentedRelated bs_lib jQuery issue #3107481: Try to remove jQuery dependency.
Comment #6
pivica commentedMoving to 2.x version. Bootstrap 5 now has built-in support for offset component (https://getbootstrap.com/docs/5.0/components/offcanvas/), we will use this instead of any custom JS solution. Updated issue description with new info.
Comment #7
pivica commentedComment #9
pivica commentedPushed MR, here is a list of changes:
Configuration
- Replaced navbar_offcanvas.type + navbar_offcanvas.position with single navbar_responsive_type setting
- New values: collapse, offcanvas-start, offcanvas-end, off
Theme Preprocessing (bs_base.theme)
- New navbar_attributes variable with navbar-expand-ncrb class for responsive behavior
- New is_offcanvas and navbar_responsive_type template variables
- Simplified bs_lib_toggle_button preprocess (removed Jasny-specific attributes)
Templates
- region--navbar.html.twig: New offcanvas_header block with Bootstrap 5 btn-close, offcanvas-body wrapper
- page.html.twig: Uses navbar_attributes instead of hardcoded classes
- menu--navbar.html.twig: Removed deprecated offcanvas-specific markup
JavaScript (navbar.js)
- Refactored to vanilla JS where practical
- Updated to Bootstrap 5 Offcanvas API
- Renamed isNavbarCollapseShow to isLinkNavbarResponsiveShow
- Fixed multi-level dropdown support in responsive navbar
SASS/CSS
- Removed navigation.css (split into nav.scss and navbar.scss) - this is actually from before, i forgot to compile... so it is going here.
- New offcanvas.scss with Bootstrap 5 responsive offcanvas styles
- Custom navbar-expand-ncrb and offcanvas-ncrb breakpoint classes
Update Hook (bs_base_bs_update_200007)
Trying to help in migration:
- Auto-migrates old config to new format
- Warns about deprecated CSS classes and JS patterns
- Auto-renames isNavbarCollapseShow in child theme JS files
Comment #10
pivica commentedComment #12
pivica commentedDone.