Skip to content

fix(theme): align the modal recipes with the Dialog standard - #368

Merged
alexgrozav merged 3 commits into
align-component-styles-uxf-487from
modal-dialog-uxf-495
Oct 29, 2026
Merged

alexgrozav merged 3 commits into
align-component-styles-uxf-487from
modal-dialog-uxf-495

Conversation

@alexgrozav

@alexgrozav alexgrozav commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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 at calc(100% - 2rem) high and, per size, at min(24rem | 32rem | 48rem, 100% - 2rem) wide, so it fits at 320px and grows with its text. Long titles wrap (overflow-wrap: anywhere). fullscreen lifts both caps.
  • dialog/actions-in-view: the header and footer no longer shrink, and the body has min-height: 0 and overflow-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 is CanvasText under forced-colors, and currentColor under prefers-contrast: more.
  • dialog/mirrors-in-rtl: the shared section recipes pad with padding-inline-start and padding-inline-end.
  • dialog/backdrop: the soft surfaces gain a border in the dark theme, where the backdrop barely shows.
  • dialog/contrast: modalContrast.test.ts checks 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 soft border. Their tests now register the new utilities.

Storybook: the stories and grid previews lose their inline styles, the title is an <h2> that names a role="dialog" panel, overlays render with v-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

  • 🐞 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📖 Documentation
  • ♻️ Refactor / internal (no functional change)
  • 🔧 Build / tooling / CI

Checklist

  • My commits follow Conventional Commits with a package scope (e.g. feat(theme): …)
  • I ran pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm test and 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)
  • I added a changeset (pnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/tests
  • I added or updated tests where relevant
  • I updated documentation where relevant
  • I did not edit generated files (dist/, .styleframe/)
  • My PR targets main and stays focused in scope (it targets the integration branch)

Notes / screenshots

  • The modal no longer fills the overlay's width. Each size now caps it, so a consumer's own max-width can go. That fills a gap in the rules rather than changing the API, so the changeset is a patch.
  • The scroll lock depends on the overlay being in the DOM. An overlay that stays mounted while hidden, like one behind 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.
  • The more-contrast border is !important. A media query adds no specificity, so without it the color compounds' border classes win by source order, in both themes.
  • No Should rule was declined.

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.
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
styleframe-dev Ready Ready Preview Oct 29, 2026 3:22pm UTC
styleframe-dev-storybook Ready Ready Preview Oct 29, 2026 3:22pm UTC

Request Review

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.
@alexgrozav
alexgrozav merged commit 3da18ee into align-component-styles-uxf-487 Oct 29, 2026
3 checks passed
@alexgrozav
alexgrozav deleted the modal-dialog-uxf-495 branch October 29, 2026 18:37

This branch was successfully deployed

2 active deployments
Preview – styleframe-dev — e3113b79 Deployed Oct 29, 2026 by vercel[bot]
Preview – styleframe-dev-storybook — e3113b79 Deployed Oct 29, 2026 by vercel[bot]
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