rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
443 stars 50 forks source link

`.popover-body` should include only user contents #997

Open gadenbuie opened 4 months ago

gadenbuie commented 4 months ago

In the current configuration, we add the <button> element inside the .popover-body > div container.

<div class="popover-body">
    <div style="display:contents;">
        <!-- user content here -->
        <button type="button" aria-label="Close" class="btn-close" style="position:absolute; top:0.6rem; right:0.25rem; width:0.55rem; height:0.55rem; background-size:0.55rem;"></button>
    </div>
</div>

It'd be helpful to keep the .popover-body to just having user-supplied content. The close button could be a sibling of .popover-body without changing appearance or (probably) behavior. The goal is that users should be able to write rules like .popover-body > div > :last-child to target the final (or first) content element in the popover.

In particular, I wanted to do something like

.popover-body > div > :last-child {
  margin-bottom: 0
}