Skip to content

Fullscreen modal margin#2567

Open
adamlobler wants to merge 4 commits into
masterfrom
fullscreen-modal-margin
Open

Fullscreen modal margin#2567
adamlobler wants to merge 4 commits into
masterfrom
fullscreen-modal-margin

Conversation

@adamlobler
Copy link
Copy Markdown
Collaborator

@adamlobler adamlobler commented May 27, 2026

Modal fixes:

  • The fullscreen Modal variant previously covered the entire viewport, making it hard to tell it was a modal. A new fullScreenMargin token adds separation from the viewport edge to fix that a11y issue on bigger screen sizes.
  • borderRadius from the component theme wasn't applying because Dialog's hardcoded inline borderRadius: inherit always overrode the Emotion CSS class. Dialog now accepts a style prop so consumers can override that default.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2567/

Built to branch gh-pages at 2026-05-28 10:52 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

Visual regression report

No changes.

Status Count
Unchanged 32
Changed 0
New 0
Removed 0

📊 View full report

Baselines come from the visual-baselines branch. They refresh on every merge to master.

github-actions Bot pushed a commit that referenced this pull request May 27, 2026
@adamlobler adamlobler requested review from hajnaldo and matyasf May 28, 2026 11:03
Copy link
Copy Markdown
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

Please write a "How to test" part in the PR description too

* Inline styles applied to the root element. Merged with the default
* `borderRadius: inherit` so consumers can override it.
*/
style?: React.CSSProperties
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We do not allow to set users CSS for our components. It opens up way too many possibilities leading to inconsistent design and bugs for users during internal styles changes.

We could pass have a borderRadius prop if needed (that defaults to inherit)

componentDidMount() {
this.props.makeStyles?.()
window.addEventListener('resize', this.updateHeight)
window.addEventListener('resize', this.updateSize)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We might need some conditionals here, window does not exists in SSR environments an in Jest unit tests

} = this.props

const isFullScreen = size === 'fullscreen'
const isSmallScreen = this.state.windowWidth < 480 // 30em at 16px base
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A bit off, but in the previous styling enginer breakpoints were defined at theme level. This might be better for us too, so we dont have components changing visuals lots of times when resizing a window.

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