Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for off canvas menu toggle #1301

Open
2dareis2do opened this issue Apr 16, 2024 · 6 comments
Open

Add support for off canvas menu toggle #1301

2dareis2do opened this issue Apr 16, 2024 · 6 comments

Comments

@2dareis2do
Copy link

On Bootstrap the fly out menu seems to be the default, at least on the get-bootstrap site.

From what I can tell all the demos for bootswatch use a dropdown menu. Is it possible to also add support for off canvas style menu as well? From what I can tell the funtionality os easily added but the colour scheme appear to be off. An example of this is with the Sketchy theme.

Screenshot 2024-04-16 at 21 33 27 Screenshot 2024-04-16 at 21 36 00 Screenshot 2024-04-16 at 21 36 11 Screenshot 2024-04-16 at 21 38 40
@2dareis2do
Copy link
Author

Looking in a bit more detail, it appears some additional styles are required for this. e.g. get-boostrap uses https://github.com/twbs/bootstrap/blob/ad0cc68b7e226d9e1c1feb39ca68c0404c304365/site/assets/scss/_navbar.scss#L2

These seems to be site specific settings the main one appears to be the use of the .bd-navbar class to add additional styling when using offcanvas for menu items (this is a little different for no menu items.

@2dareis2do
Copy link
Author

Not sure this is included with npm

site/assets/scss/_navbar.scss

@2dareis2do
Copy link
Author

One workaround it seems is to apply the bg-primary class to the off canvas element.

@thomaspark
Copy link
Owner

Hi @2dareis2do, is there any css on your site that might be making the offcanvas text color white?

It looks ok here

Screenshot 2024-04-17 at 12 25 07 PM

@2dareis2do
Copy link
Author

2dareis2do commented Apr 17, 2024

Thanks @thomaspark

The issue is that if you use off canvas for the nav, similar to get-bootstrap.com, then the background colour is also white and the text is white. The workaround i have is to add the background class similar to how it is done on the on screen nav. get bootstrap seems to have site specific scss to handle this.

Screenshot 2024-04-17 at 17 56 31 Screenshot 2024-04-17 at 17 56 47

I have attached 2 screen shots that so nav working in both light and dark modes (media query).

@thomaspark
Copy link
Owner

Ah thanks, that seems like a nice solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants