Repository navigation
feat(modal): add an after slot under the dialog's card - #40
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
9k.school wants "Forgot your password?" under its course-page sign-in dialog, on the backdrop, as its
/loginpage has the link under the card (ismail9k/9k.school#320). A native modal<dialog>shows only what is inside it, soI9kModalneeds a place inside the<dialog>but outside its card.What
afterslot: rendered inside the<dialog>(top layer, focus order, above the backdrop), after the card, centred, only while open.<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.WithAfterstory, and two tests (placement; no wrapper without the slot).Validation
vitest run1016 passed,typecheck,build, Prettier and ESLint on the changed files.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