feat(col): modernizing Grid component #30658
Open
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.
What is the current behavior?
The existing grid component (
ion-grid
,ion-row
, andion-col
) in Ionic was developed several years ago and has not received significant updates since then. As a result, it does not leverage modern CSS features. For example, the gutter (spacing) between columns is implemented using the border property, which is an outdated technique.What is the new behavior?
--ion-grid-gap
: this new CSS variable, will indicate the gap size in the grid. Defaults to0px
- the current value.ion-col
: has a new way to calculate the width of the column. Additionally a new propertyorder
(and responsive variants) was added, and will control the order of the column.ion-row
: uses the newly introduced custom property--ion-grid-gap
. This property will indicate the gap size in the grid.Does this introduce a breaking change?
The properties
pull
andpush
fromion-col
, have been removed. The functionality achieved with them, is now achieved with the new propertyorder
and the existingsize
. More information and migration examples can be read inBREAKING.md
file.Other information