Hamburger Menu and horizontal lines changes


#1

How do you change the mobile Hamburger background color menu and the horizontal lines? Example Green background, the horizontal lines black.
Does anyone know the Classes that control these setting?
Do you make a custom class, if so what Element do you choose?


#2

Hi @KBConcepts

You can add the following code to page settings:

<style>


#nav-toggle .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='green' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
  background-color: black;
}

</style> 

Green Hamburger with black BG.bloc (200.7 KB)

MDS


#3

Thank you @MDS for the quick reply. :grinning:
I was looking everywhere in the class section including subclasses, but could not find anything.
I really didn’t want to mess with the edit the HTML, but that is what I have to do so be it.


#4

You’re welcome.

MDS


#5

Changing the background colour is pretty easy. Just select the menu toggle and create a custom class. Then change the colour background to whatever you want.


#6

Yeah @Flashman that is easy if you know it. I do now. :grinning:
Using the Class Manager how do you change the bars?


#7

Using the class manager I don’t think you can at this stage and it requires code in the header. I seem to recall the colours had to be done in a certain way so they work in Firefox as well.


#8

Sounds like what @MDS mentioned above.
Why wouldn’t Blocs 3 be able to do that @Norm?


#9

It’s a basic limitation of Bootstrap 4 that limits you to light or dark and yes pretty much every Blocs user is looking for an easier solution.


#10

The easiest way is to use an icon instead of the default Bootstrap 4 svg. Then you can style it the same way that you could with Blocs 2/Bootstrap 3.

You may want to check some of my previous post replies.

MDS


#11

So @MDS are you saying using Blocs 2x the style can change the background and the color of the horizontal bars?
I will gladly look at your prevision post. To save time what would the topic be under?


#12

Hi @KBConcepts

That’s correct, Blocs 2 use bootstrap 3 and Blocs 3 use bootstrap 4 which uses a svg for the mobile icon.
Here’s a way you could change colors of the mobile menu in Blocs 2. (which doesn’t work in Blocs 3)
I don’t think we can change the menu icon svg in Blocs 3 today, but maybe we will at some point.

Cheers


#13

Hi @KBConcepts

Not sure I understand your question…

In Blocs 2 you could style the hamburger color and background (it was an icon).

In Blocs 3, the hamburger has become an svg image file (like @Jakerlund just mentioned). This is why many people have difficulties modifying it. And I must say it is not the easiest. But some of the code provided works. For ease of reference on Blocs 3 changes:

https://help.blocsapp.com/knowledge-base/change-toggle-navigation-symbol-colour/

You can look at the following post I replied to Coloring the toggle - solved

So if you want to style the hamburger in Blocs 3, another way is to build your own navigation using an icon. Then there will be a little more work but that is the cost of freedom :wink:

MDS


#14

Thank you for taking the time to answer this? :grinning:


#15

So helpful thank you :grinning:


#16

@MDS, Neat solution on your link. :+1:
I was so close but no cigar, so i gave up.

Thanks


#17

@Jakerlund :wink:


#18

@MDS I looked up Bootstrap 4 Hamburger Toggle Color Choices, but cannot locate a link showing the codes for the color that can be used. I even tried SVG Color Codes and came up with nothing. I’m sure all you professional web builders know what I’m asking for.


#19

Hi @KBConcepts

You can use any color. I selected green and black as it was your original request.

Simply use rgba code for the colors you wish to choose. In the following code, I have used rgba (green and black) simply replace the values to the colors you wish to use. For the bars of the svg, you change the stroke color and for the background is appears at the end of the coee.

<style>

#nav-toggle .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0,153,102,1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");

background-color: rgba(0,0,0,1);
 
 }
</style>

The updated file:

Green Hamburger with black RGBA.bloc (204.0 KB)

MDS


Hamburger menu color Blocs3
#20

I fell like I’m a student learning basic stuff, but I have to begin somewhere. :slight_smile:
Thanks again @MDS for making this clear and sharing the bloc file.
I did find something the would give me the color values.
I’m sure there are better ones, but this will work for now.
https://www.ginifab.com/feeds/pms/color_picker_from_image.php