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

How to easily customize the style of dropdown submenus? #460

Open
stefanobartoletti opened this issue Jan 15, 2020 · 1 comment
Open

How to easily customize the style of dropdown submenus? #460

stefanobartoletti opened this issue Jan 15, 2020 · 1 comment

Comments

@stefanobartoletti
Copy link

Is there a way to easily add classes to elements of the dropdown submenus, in order to correctly style them and their child elements?

Right now, they always get the default styles, which is a white background whit blue highlight.

Is it possible to somehow pass list of classes to add to the relevant elements when the WP_Bootstrap_Navwalker() is instantiated? This would make it easier to always keep the relevant styling, because by directly modifying wp-bootstrap-navwalker.php all customizations would be lost when updating to new released versions.

As an example, with a simple dropdown with just one sublevel, I think that the elements that should be able to receive list of classes should be:
ul.dropdown-menu > li.nav-item > a.dropdown-item.

I don't know what could be the best way to accomplish this, but like I said, a suggestion could be to have variables containing list of classes passed down when instantiating the class, in a similar way of the Wordpress core function wp_nav_menu()

@IanDelMar
Copy link
Collaborator

Related to #458

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

No branches or pull requests

2 participants