Skip to content

fix(toolbar, card): resolve styling conflicts when offcanvas is used as a toolbar trigger#1329

Merged
gadenbuie merged 2 commits into
mainfrom
offcanvas/fix-in-toolbar
Jul 1, 2026
Merged

fix(toolbar, card): resolve styling conflicts when offcanvas is used as a toolbar trigger#1329
gadenbuie merged 2 commits into
mainfrom
offcanvas/fix-in-toolbar

Conversation

@gadenbuie

@gadenbuie gadenbuie commented Jul 1, 2026

Copy link
Copy Markdown
Member

Follow up to #1328

Fixes two CSS issues discovered while adding an example that uses an offcanvas as a card-header toolbar trigger.

Fixes

  • The toolbar's item styling rules (compact font-size, width: auto, align-self: center, margin-bottom: 0) were leaking into a nested offcanvas() panel and its backdrop, since both land as DOM children of the toolbar when offcanvas is used as a toolbar trigger. This broke the panel's font size and the width of both the panel and its backdrop.
  • The card's full-screen "enter" button could render on top of an open offcanvas panel. The panel stays a DOM descendant of the card even though it's a page-level overlay, so hovering it bubbles up and triggers the card's :hover state, revealing the button — whose z-index is higher than the offcanvas's.

gadenbuie added 2 commits July 1, 2026 12:59
…styling

The toolbar's `& *` font-size rule and `& > *` layout overrides
(margin-bottom, width, align-self) were leaking into a nested
bslib-offcanvas panel and its .offcanvas-backdrop. Both land as DOM
children of the toolbar when offcanvas() is used as a toolbar trigger,
since Bootstrap inserts the backdrop into the offcanvas element's
parentNode and bslib places the panel as a sibling of its trigger.
This shrank the offcanvas panel's text and broke its width (both for
the panel itself and its backdrop, which needs 100vw).
…open

A bslib-offcanvas panel is visually a page-level overlay, but it stays
a DOM descendant of the card it's wired from (e.g. via a toolbar
trigger in the card header). Hovering the open panel therefore bubbles
up and triggers the card's :hover state, revealing the full-screen
enter button on top of it, since the button's z-index (popover) is
higher than the offcanvas's.
@gadenbuie gadenbuie merged commit c0bfaf1 into main Jul 1, 2026
11 checks passed
@gadenbuie gadenbuie deleted the offcanvas/fix-in-toolbar branch July 1, 2026 17:06
@github-actions github-actions Bot restored the offcanvas/fix-in-toolbar branch July 1, 2026 17:06
@gadenbuie gadenbuie mentioned this pull request Jul 1, 2026
@gadenbuie gadenbuie deleted the offcanvas/fix-in-toolbar branch July 2, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant