Repository navigation
fix(theme): align the modal recipes with the Dialog standard - #368
Merged
Merged
Conversation
The modal panel now fits the screen less a 1rem margin, caps its width per size in rem, wraps long titles, keeps its header and footer in view while the body scrolls, and locks the page while an overlay is open. Its border stays visible in forced colors mode and goes to full strength with more contrast. The shared section recipes pad with logical properties, and soft panels gain a border in the dark theme, so the drawers inherit both.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The footer's actions wrap onto a new row, so a third action no longer clips at 320px, and the panel scrolls as a whole when even its header and footer don't fit. The docs no longer credit other recipes' focus rings to color.focus, and the changeset opens its sentences on words.
7 of 13 tasks
This branch was successfully deployed
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.
Description
Brings the Modal recipes in line with the stylesheet rules of the Open Components Dialog page. Each rule has a test named after its ID.
dialog/fits-screen,dialog/resizable: the panel is capped atcalc(100% - 2rem)high and, per size, atmin(24rem | 32rem | 48rem, 100% - 2rem)wide, so it fits at 320px and grows with its text. Long titles wrap (overflow-wrap: anywhere).fullscreenlifts both caps.dialog/actions-in-view: the header and footer no longer shrink, and the body hasmin-height: 0andoverflow-y: auto, so only the body scrolls when the content doesn't fit. The footer's actions wrap on a narrow screen, and the panel scrolls as a whole (overflow: auto) only when even its header and footer don't fit.dialog/scroll-lock::root:has(.modal-overlay)hides the page's overflow and keeps its scrollbar gutter, as the page's reference CSS does with:modal.dialog/forced-colors,dialog/more-contrast: the border isCanvasTextunderforced-colors, andcurrentColorunderprefers-contrast: more.dialog/mirrors-in-rtl: the shared section recipes pad withpadding-inline-startandpadding-inline-end.dialog/backdrop: thesoftsurfaces gain a border in the dark theme, where the backdrop barely shows.dialog/contrast:modalContrast.test.tschecks 4.5:1 for the text of all nine surfaces in both themes.dialog/reduced-motion: the recipes don't animate, and a test keeps it that way.The drawers share the overlay factory, so they inherit the logical padding, the wrapping footer and the dark-theme
softborder. Their tests now register the new utilities.Storybook: the stories and grid previews lose their inline styles, the title is an
<h2>that names arole="dialog"panel, overlays render withv-if, and there are new Focus, LongContent, LongTitle and RightToLeft stories. The docs page has a section on what the recipes do for each rule.Related issue
None on GitHub.
Type of change
Checklist
feat(theme): …)pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm testand everything passes (the package-level checks ran: theme tests, typecheck and build, oxlint and oxfmt on the touched files, plus the Storybook and docs builds)pnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/testsdist/,.styleframe/)mainand stays focused in scope (it targets the integration branch)Notes / screenshots
max-widthcan go. That fills a gap in the rules rather than changing the API, so the changeset is a patch.v-show, would keep the page from scrolling. The docs say to render it only while the modal is open. GitHub code search finds no use of the modal recipes in Inkline.!important. A media query adds no specificity, so without it the color compounds' border classes win by source order, in both themes.