bootstrap-flask
bootstrap-flask copied to clipboard
Allow extra classes on render_icon
Use case: the light/dark toggler from Bootstrap's own documentation makes use of classes such as me-2 for spacing and theme-icon-active for query selecting.
Was thinking about this earlier. Thanks for the request. Working on a PR now.
@greyli In the example, why do the links at the end of the nav menu use <li>...</li> and the render_nav_item() don't?
<a class="nav-item nav-link"
href="[/icon](view-source:http://127.0.0.1:5000/icon)">
Icon
</a>
<a class="nav-item nav-link"
href="[/icons](view-source:http://127.0.0.1:5000/icons)">
Icons
</a>
<li class="nav-item"><a class="nav-link" href="[https://bootstrap-flask.readthedocs.io/](view-source:https://bootstrap-flask.readthedocs.io/)" target="_blank">Documentation</a></li>
<li class="nav-item"><a class="nav-link" href="[https://getbootstrap.com/docs/5.1/getting-started/introduction/](view-source:https://getbootstrap.com/docs/5.1/getting-started/introduction/)" target="_blank">Bootstrap Documentation</a></li>
See also https://github.com/helloflask/bootstrap-flask/blob/master/examples/bootstrap5/templates/base.html#L41 and https://getbootstrap.com/docs/5.3/components/scrollspy/#non-visible-elements
Both work, but what is reommended? With out without the <li>?
I'm not sure. Users can control this with _use_li parameter based on their preference, so I don't think we need to change anything.