Skip to content

docs(modal): reorganize Styling and add Sizing to Content section - #4689

Open
brandyscarney wants to merge 8 commits into
mainfrom
FW-7731
Open

brandyscarney wants to merge 8 commits into
mainfrom
FW-7731

Conversation

@brandyscarney

@brandyscarney brandyscarney commented Sep 1, 2026

Copy link
Copy Markdown
Member

Description

Other information

Previews:

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ionic-docs Ready Ready Preview Sep 14, 2026 6:33pm UTC

Request Review

Comment thread docs/api/modal.mdx
:::note
### Styling

If you are building an Ionic Angular app, the styles need to be added to a global stylesheet file. Read [Style Placement](#style-placement) in the Angular section below for more information.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Style Placement section has been removed since v6 so I deleted this entire note: 997fe9e

Comment thread docs/api/modal.mdx
<SheetScrollingContentExample />

## Styling
## Theming

@brandyscarney brandyscarney Sep 1, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reorganizing the sections into Theming -> Styling to match other components, see: https://ionicframework.com/docs/api/action-sheet#theming

I considered updating the playground directory structure but moving any would break the JP docs.

Comment thread docs/api/modal.mdx
<ThemeExample />

### Animations
## Animations

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I promoted Animations out of Theming because it doesn't actually change any styles.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated older documentation so any future deployments would be accurate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you expect any of the archived versions to be unfrozen? I can understand v7 but v6 seems very unlikely.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had to unfreeze and fix the v6 deployment just last year so while I don't want to have to unfreeze it, I'd rather it have the correct documentation if we ever re-deploy it.

Comment thread docs/api/modal.mdx
Comment on lines +180 to +182
[Controller modals](#controller-modals) are appended to the root of your application, outside of the component that presented them. Component-scoped styles will not reach these modals, so their styles must be applied globally, from a stylesheet that is not scoped to a component.

:::note
[Inline modals](#inline-modals-recommended) stay where they are declared in your template, so component-scoped styles do apply to them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can revert this if desired - but I don't know why inline modals were specified here as needing to be overridden globally. We can target ion-modal directly from the example component.

@brandyscarney
brandyscarney marked this pull request as ready for review September 1, 2026 22:11
@brandyscarney
brandyscarney requested a review from a team as a code owner September 1, 2026 22:11
@brandyscarney brandyscarney changed the title docs(modal): reorganize styling section and add Sizing to Content section docs(modal): reorganize Styling and add Sizing to Content section Sep 1, 2026

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you! Minor things.

Comment thread docs/api/modal.mdx Outdated
Comment thread docs/api/modal.mdx Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you expect any of the archived versions to be unfrozen? I can understand v7 but v6 seems very unlikely.

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShaneK ShaneK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pull Bot pushed a commit to LoadsAForks/ionic-framework that referenced this pull request Sep 14, 2026
…onic-team#31413)

Issue number: resolves ionic-team#31149

---------

## What is the current behavior?
Setting `--height` to any of the following on an `ion-modal` containing
an `ion-content` results in the `ion-content` collapsing to `0` height:
`auto`, `fit-content`, `min-content`, or `max-content`.

## What is the new behavior?
- Checks if modal `--height` is set to `auto`, `fit-content`,
`min-content,` or `max-content` and styles the `ion-content`, `ion-nav`
and `.ion-page` appropriately if so
- Watches for changes to `--height` on `ion-modal` to dynamically add
and remove the class that sizes the `ion-content` to its content
- Updates modal `--max-height` to `100%` which allows the content to
scroll instead of overflowing and being clipped
- Adds a preview test for different scenarios where `ion-modal` has
`--height` set
- Adds e2e tests for the various `--height` scenarios
- Updates `safe-area-utils` to account for the new content-sized modals
- Adds spec tests for all new functions

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

**Dev build**: `9.0.1-dev.11788212611.154b1596`

**Previews**: 
- [Modal: Content
Height](https://ionic-framework-git-fw-7731-ionic1.vercel.app/src/components/modal/test/content-height)
- [Modal: Safe
Area](https://ionic-framework-git-fw-7731-ionic1.vercel.app/src/components/modal/test/safe-area)

**Docs PR**: ionic-team/ionic-docs#4689

---------

Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
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.

3 participants