-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Correct use of navbar-burger? #1515
Comments
It also seems that the documentation shouldn't use a <div class="navbar-burger">
<span></span>
<span></span>
<span></span>
</div> This is what have been working for me. |
Thanks, the div works well here too. |
Yup, it's supposed to be a div based on the working examples being divs and my own experimentation. I addressed this is a PR over here that hopefully will get included in the next release! |
Cool - that's one half. The other half is the bulma.io site which uses |
I believe that the bulma/docs/_javascript/main.js Lines 43 to 56 in fdeba5d
The navbar example in the documentation uses Therefore, the only relevant class for Bulma is |
Ah thanks - I had checked through css/bulma.css, but not through the javascript
From the point of view of analysing a site, it would be nice if all the bulma css classes had some common prefix so you could recognise them as belonging to bulma. But from another point of view, it would be a lot of extra typing. |
If you are using JQuery try this // Close mobile & tablet menu on item click
$('.navbar-item').each(function(e) {
$(this).click(function(){
if($('#navbar-burger-id').hasClass('is-active')){
$('#navbar-burger-id').removeClass('is-active');
$('#navbar-menu-id').removeClass('is-active');
}
});
});
// Open or Close mobile & tablet menu
$('#navbar-burger-id').click(function () {
if($('#navbar-burger-id').hasClass('is-active')){
$('#navbar-burger-id').removeClass('is-active');
$('#navbar-menu-id').removeClass('is-active');
}else {
$('#navbar-burger-id').addClass('is-active');
$('#navbar-menu-id').addClass('is-active');
}
}); With the following HTML (Using https://fontawesome.com/ like <nav id="navMenu" class="navbar is-fixed-top" role="navigation" aria-label="main navigation">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item" href="#"><i class="fas fa-home fa-lg"></i></a>
<a class="navbar-item is-hidden-desktop" href="#where-hours"><i class="far fa-clock fa-lg"></i></a>
<div id="navbar-burger-id" class="navbar-burger">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div id="navbar-menu-id" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="#section-1">First Section</a>
<a class="navbar-item" href="#section-2">Second Section</a>
<a class="navbar-item" href="#section-3">Third Section</a>
</div>
<div class="navbar-end">
<a class="navbar-item is-hidden-touch" href="#where-section"><i class="far fa-clock fa-lg"></i></a>
</div>
</div>
</div>
</nav> Hope it'll help 😄 |
Also, when I follow the example on the site, I can get the burger menu to collapse and open, but unlike on the website, I can't get the menu bar to display when the page is wide. That is, I get the burger menu, and only the burger menu also on the desktop. Sigh... I am on the hero docs btw. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
When following the example provided in the documentation, clicking on the burger triggers a page reload. As suggested in an issue on the official Bulma GitHub repository (jgthms/bulma#1515), changing the <a> to a <div> fixes the problem.
This is about the Docs.
Overview of the problem
Inconsistent use of
navbar-burger
in the site itself, versus examples shown.This is about the Bulma Docs
I'm using Bulma version 0.6.1
Description
The navbar documentation says that the navbar burger should be
However, Bulma's own site has a number of instances of div or span with
The second class (
.burger
) doesn't appear in the CSS at all, as far as I can see.The site is a very useful working reference of Bulma in action, so it would be good to be accurate. Should the
burger
class be there, or is it an error?Steps to Reproduce
The text was updated successfully, but these errors were encountered: