-1

I've been using bootstrap for a while. I'm wondering if there's way to change the bootstrap toggler icon.

M_W
  • 66
  • 2
  • 14

3 Answers3

2
.navbar-dark .navbar-toggler-icon {
    background-image: url(data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E);
}

this code is responsible to generate the nav icon. replace the image you get a new look.

Mobarak Ali
  • 751
  • 5
  • 19
0

It's actually an svs comes with bootstrap, you can't simply change the icon unless you use your own customised one. :)

M_W
  • 66
  • 2
  • 14
0

It's defined in bootstrap.min.css as:

.navbar-light .navbar-toggler-icon {
 background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30'
 xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)'
 stroke-width='2' stroke-linecap='round' stroke-miterlimit='10'
 d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")
}

So, overriding this with your own image, as shown below is reasonably straight-forward:

.navbar-light .navbar-toggler-icon {
background-image: url("https://cdn4.iconfinder.com/data/icons/ionicons/512/icon-ios7-bell-512.png");
}
GoGoWorx
  • 181
  • 1
  • 4