A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/issues/4022 below:

Dropdown subcomponents should allow adding a `class` on their `<li>` elements · Issue #4022 · bootstrap-vue/bootstrap-vue · GitHub

Is your feature request related to a problem? Please describe...

I propose that b-dropdown-item and all other dropdown subcomponents (b-dropdown-group, b-dropdown-text, ...) should accept a list-item-class prop, which consistently adds a class attribute to the component root elements. This makes it easier to style dropdown children.

Describe the solution you'd like

Adding list-item-class to any dropdown subcomponent should result in the following rendered markup

Template

<b-dd>
  <b-dd-group list-item-class="clazz" />
</b-dd>

Rendered output

<!-- other properties omitted for clarity -->
<ul>
  <li class="clazz" />
</ul>

While adding a class prop currently works for <b-dropdown-item>, it does not work for many other dropdown subcomponents. Adding a class to e.g. a <b-dropdown-text> adds the class to the nested span element instead of the root li element.

Describe alternatives you've considered

I've considered using :nth-child selectors to style the dropdown children, but this seems hacky and also does not work for complex setups. (e.g. multi-column).


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4