Skip to content

feat(grid, col): resolve breakpoints from config - #31518

Merged
brandyscarney merged 15 commits into
FW-7285-2-configfrom
FW-7285-3-grid-col
Oct 14, 2026
Merged

brandyscarney merged 15 commits into
FW-7285-2-configfrom
FW-7285-3-grid-col

Conversation

@brandyscarney

@brandyscarney brandyscarney commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Issue number: internal


What is the current behavior?

The previous PR in this stack added the screenBreakpoints config option and the @utils/breakpoints helpers, but nothing consumes them yet.

ion-grid gets its responsive padding and fixed widths purely from @media queries, with the thresholds compiled into the CSS. ion-col only expresses per-breakpoint values through breakpoint-suffixed properties (size-xs through size-xl, plus the order-* and offset-* equivalents). Neither reads the configured breakpoints, and neither can target xxl.

ion-grid also declared its own ION_GRID_BREAKPOINTS / IonGridBreakpoint (carrying a TODO(FW-7285)) rather than using the shared type.

What is the new behavior?

  • Grid and column padding and fixed widths now follow the screenBreakpoints config. They change at the configured widths rather than at thresholds fixed when the framework was built, so moving a breakpoint moves the layout with it.
  • The default fixed widths assume the default thresholds. Lowering a threshold without lowering its width leaves the grid wider than the screen, where max-width: 100% clamps it and it is no longer fixed. Set the matching --ion-grid-breakpoint-*-width variables alongside the config.
  • ion-col accepts an object of breakpoint values for size, order and offset: col.size = { xs: 12, md: 6 }. This is resolved against the configured breakpoints. xxl is added to this object. An empty string or null at a breakpoint resets that column to the default flex layout.
  • All suffixed properties are deprecated, but not removed. They still work and log a deprecation warning. If both forms are set for the same property, the object form wins and the suffixed ones are ignored with a warning. They will be removed in a future major release.
  • ION_GRID_BREAKPOINTS / IonGridBreakpoint and ION_COL_BREAKPOINTS / IonColBreakpoint are replaced by the shared ScreenBreakpoint.

Does this introduce a breaking change?

  • Yes
  • No

The size, order, and offset prop types have been widened from string | undefined to BreakpointMap<string | number | null> | number | string | undefined. The suffixed properties continue to work as before.

BREAKING.md has been updated under 10.x with migration guidance for these deprecations. The push/pull entry has also been moved from the Grid section to Col, where the properties are defined.

Other information

Preview

@brandyscarney
brandyscarney added this pull request to stack #31503 October 1, 2026 17:24
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Oct 13, 2026 7:38pm UTC

Request Review

@github-actions github-actions Bot added the package: core @ionic/core package label Oct 1, 2026
@brandyscarney
brandyscarney marked this pull request as ready for review October 2, 2026 14:06
@brandyscarney
brandyscarney requested a review from a team as a code owner October 2, 2026 14:06
@brandyscarney
brandyscarney requested review from thetaPC and removed request for a team October 2, 2026 14:06

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

Looks really good overall! Just a couple of things, mainly the grid and col holding onto a stale breakpoint after being removed and re-added, plus the deprecation warning firing once per column. The rest are small.

Comment thread core/src/components/grid/grid.tsx Outdated
Comment thread core/src/components/col/col.tsx Outdated
Comment thread BREAKING.md
Comment thread core/src/components/col/col.tsx Outdated
Comment thread core/src/components/grid/grid.tsx Outdated

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

Awesome work!

Comment thread core/src/components/grid/grid.mixins.scss Outdated
Comment thread core/src/components/grid/test/breakpoints/index.html
Comment thread core/src/global/ionic-global.ts Outdated

@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

@brandyscarney
brandyscarney merged commit dcbebdd into FW-7285 Oct 14, 2026
80 of 101 checks passed
@brandyscarney
brandyscarney deleted the FW-7285-3-grid-col branch October 14, 2026 14:08
brandyscarney added a commit that referenced this pull request Oct 14, 2026
Issue number: internal

---------

## What is the current behavior?

The previous PR in this stack added the `screenBreakpoints` config
option and the `@utils/breakpoints` helpers, but nothing consumes them
yet.

`ion-grid` gets its responsive padding and fixed widths purely from
`@media` queries, with the thresholds compiled into the CSS. `ion-col`
only expresses per-breakpoint values through breakpoint-suffixed
properties (`size-xs` through `size-xl`, plus the `order-*` and
`offset-*` equivalents). Neither reads the configured breakpoints, and
neither can target `xxl`.

`ion-grid` also declared its own `ION_GRID_BREAKPOINTS` /
`IonGridBreakpoint` (carrying a `TODO(FW-7285)`) rather than using the
shared type.

## What is the new behavior?

- Grid and column padding and fixed widths now follow the
`screenBreakpoints` config. They change at the configured widths rather
than at thresholds fixed when the framework was built, so moving a
breakpoint moves the layout with it.
- The default fixed widths assume the default thresholds. Lowering a
threshold without lowering its width leaves the grid wider than the
screen, where `max-width: 100%` clamps it and it is no longer fixed. Set
the matching `--ion-grid-breakpoint-*-width` variables alongside the
config.
- `ion-col` accepts an object of breakpoint values for `size`, `order`
and `offset`: `col.size = { xs: 12, md: 6 }`. This is resolved against
the configured breakpoints. `xxl` is added to this object. An empty
string or `null` at a breakpoint resets that column to the default flex
layout.
- All suffixed properties are **deprecated**, but not removed. They
still work and log a deprecation warning. If both forms are set for the
same property, the object form wins and the suffixed ones are ignored
with a warning. They will be removed in a future major release.
- `ION_GRID_BREAKPOINTS` / `IonGridBreakpoint` and `ION_COL_BREAKPOINTS`
/ `IonColBreakpoint` are replaced by the shared `ScreenBreakpoint`.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

The `size`, `order`, and `offset` prop types have been widened from
`string | undefined` to `BreakpointMap<string | number | null> | number
| string | undefined`. The suffixed properties continue to work as
before.

`BREAKING.md` has been updated under 10.x with migration guidance for
these deprecations. The `push`/`pull` entry has also been moved from the
Grid section to Col, where the properties are defined.

## Other information


[Preview](https://ionic-framework-git-fw-7285-3-grid-col-ionic1.vercel.app/src/components/grid/test/breakpoints/)

---------

Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview — 7be70a4e Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants