Skip to content

feat(modal): add an after slot under the dialog's card - #40

Merged
ismail9k merged 2 commits into
mainfrom
feat/modal-after-slot
Oct 14, 2026
Merged

ismail9k merged 2 commits into
mainfrom
feat/modal-after-slot

Conversation

@ismail9k

@ismail9k ismail9k commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Why

9k.school wants "Forgot your password?" under its course-page sign-in dialog, on the backdrop, as its /login page has the link under the card (ismail9k/9k.school#320). A native modal <dialog> shows only what is inside it, so I9kModal needs a place inside the <dialog> but outside its card.

What

  • New after slot: rendered inside the <dialog> (top layer, focus order, above the backdrop), after the card, centred, only while open.
  • The card's look (border, radius, background, shadow) moves from the <dialog> to .i9k-modal__surface. The <dialog> becomes transparent and, while open, a flex column, so the card shrinks and its body still scrolls when the slot is there. Without the slot nothing changes visually.
  • The backdrop is darker for every modal: 50% to 75% black, because the slot sits on it and the page behind showed through enough to collide with a link there. The slot's text is always white (links inherit it), since the backdrop is dark in both themes.
  • Showcase registry entry (slot and gotcha), a WithAfter story, and two tests (placement; no wrapper without the slot).

Validation

  • vitest run 1016 passed, typecheck, build, Prettier and ESLint on the changed files.
  • Checked in 9k.school's sign-in dialog, dark and light, with the app's lockfile pinned to c3181e6.

Please merge with a merge commit or rebase, not a squash, so ca4eabb (which the app's lockfile pins) stays in main's history.

🤖 Generated with Claude Code

ismail9k and others added 2 commits October 14, 2026 21:08
9k.school wants "Forgot your password?" under its sign-in dialog, on the
backdrop, as its /login page has the link under the card. A native modal
<dialog> shows only what is inside it, so the slot renders inside the
<dialog> (top layer, focus order, above the backdrop) but after the card.

To make room for it, the card's look (border, radius, background, shadow)
moves from the <dialog> to .i9k-modal__surface, and the <dialog> becomes a
transparent flex column while open, so the card shrinks and its body still
scrolls when the slot is there. Without the slot nothing changes visually.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `after` slot sits on the backdrop, and at 50% black the page behind
showed through enough to collide with a link there. The backdrop is now
75% black for every modal, which also sets the dialog further apart from
the page, and the slot's text is always white, since the backdrop is dark
in both themes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ismail9k
ismail9k merged commit cd33f85 into main Oct 14, 2026
3 of 4 checks passed
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