You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->
<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->
## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
The existing grid component (`ion-grid`, `ion-row`, and `ion-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?
<!-- Please describe the behavior or changes that are being added by
this PR. -->
- `--ion-grid-gap`: this new CSS variable, will indicate the gap size in
the grid. Defaults to `0px` - the current value.
- `ion-col`: has a new way to calculate the width of the column.
Additionally a new property `order` (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?
- [x] Yes
- [ ] No
<!--
If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->
The properties `pull` and `push` from `ion-col`, have been removed. The
functionality achieved with them, is now achieved with the new property
`order` and the existing `size`. More information and migration examples
can be read in `BREAKING.md` file.
## Other information
<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
---------
Co-authored-by: Brandy Smith <[email protected]>
Co-authored-by: Brandy Smith <[email protected]>
Co-authored-by: ionitron <[email protected]>
Co-authored-by: Shane <[email protected]>
Copy file name to clipboardExpand all lines: BREAKING.md
+103Lines changed: 103 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
18
18
-[Button](#version-9x-button)
19
19
-[Card](#version-9x-card)
20
20
-[Chip](#version-9x-chip)
21
+
-[Grid](#version-9x-grid)
21
22
22
23
<h2id="version-9x-components">Components</h2>
23
24
@@ -32,3 +33,105 @@ This is a comprehensive list of the breaking changes introduced in the major ver
32
33
<h4id="version-9x-chip">Chip</h4>
33
34
34
35
- The `border-radius` of the `ios` and `md` chip now defaults to `10px` and `8px`, respectively, instead of `16px` in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"round"`, or override the `--border-radius` CSS variable to specify a different value.
36
+
37
+
<h4id="version-9x-grid">Grid</h4>
38
+
39
+
- The properties `pull` and `push` have been deprecated and no longer work. A similar look can be achieved with the newly added property `order`.
40
+
41
+
<h5>Example 1: Swap two columns</h5>
42
+
43
+
**Version up to 8.x**
44
+
```html
45
+
<ion-grid>
46
+
<ion-row>
47
+
<ion-colpush="4">1</ion-col>
48
+
<ion-colpull="4">2</ion-col>
49
+
<ion-col>3</ion-col>
50
+
</ion-row>
51
+
</ion-grid>
52
+
```
53
+
**Version 9.x+**
54
+
```html
55
+
<ion-grid>
56
+
<ion-row>
57
+
<ion-colorder="2">1</ion-col>
58
+
<ion-colorder="1">2</ion-col>
59
+
<ion-colorder="3">3</ion-col>
60
+
</ion-row>
61
+
</ion-grid>
62
+
```
63
+
64
+
<h5>Example 2: Reorder columns with specific sizes</h5>
65
+
To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `size="3" pull="9"`:
* The amount to offset the column for xs screens, in terms of how many columns it should shift to the end of the total available.
928
928
*/
929
929
"offsetXs"?: string;
930
+
/**
931
+
* The order of the column, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
932
+
*/
933
+
"order"?: string;
934
+
/**
935
+
* The order of the column for lg screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
936
+
*/
937
+
"orderLg"?: string;
938
+
/**
939
+
* The order of the column for md screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
940
+
*/
941
+
"orderMd"?: string;
942
+
/**
943
+
* The order of the column for sm screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
944
+
*/
945
+
"orderSm"?: string;
946
+
/**
947
+
* The order of the column for xl screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
948
+
*/
949
+
"orderXl"?: string;
950
+
/**
951
+
* The order of the column for xs screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
952
+
*/
953
+
"orderXs"?: string;
930
954
/**
931
955
* The amount to pull the column, in terms of how many columns it should shift to the start of the total available.
956
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
932
957
*/
933
958
"pull"?: string;
934
959
/**
935
960
* The amount to pull the column for lg screens, in terms of how many columns it should shift to the start of the total available.
961
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
936
962
*/
937
963
"pullLg"?: string;
938
964
/**
939
965
* The amount to pull the column for md screens, in terms of how many columns it should shift to the start of the total available.
966
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
940
967
*/
941
968
"pullMd"?: string;
942
969
/**
943
970
* The amount to pull the column for sm screens, in terms of how many columns it should shift to the start of the total available.
971
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
944
972
*/
945
973
"pullSm"?: string;
946
974
/**
947
975
* The amount to pull the column for xl screens, in terms of how many columns it should shift to the start of the total available.
976
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
948
977
*/
949
978
"pullXl"?: string;
950
979
/**
951
980
* The amount to pull the column for xs screens, in terms of how many columns it should shift to the start of the total available.
981
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
952
982
*/
953
983
"pullXs"?: string;
954
984
/**
955
985
* The amount to push the column, in terms of how many columns it should shift to the end of the total available.
986
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
956
987
*/
957
988
"push"?: string;
958
989
/**
959
990
* The amount to push the column for lg screens, in terms of how many columns it should shift to the end of the total available.
991
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
960
992
*/
961
993
"pushLg"?: string;
962
994
/**
963
995
* The amount to push the column for md screens, in terms of how many columns it should shift to the end of the total available.
996
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
964
997
*/
965
998
"pushMd"?: string;
966
999
/**
967
1000
* The amount to push the column for sm screens, in terms of how many columns it should shift to the end of the total available.
1001
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
968
1002
*/
969
1003
"pushSm"?: string;
970
1004
/**
971
1005
* The amount to push the column for xl screens, in terms of how many columns it should shift to the end of the total available.
1006
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
972
1007
*/
973
1008
"pushXl"?: string;
974
1009
/**
975
1010
* The amount to push the column for xs screens, in terms of how many columns it should shift to the end of the total available.
1011
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
* The amount to offset the column for xs screens, in terms of how many columns it should shift to the end of the total available.
6862
6898
*/
6863
6899
"offsetXs"?: string;
6900
+
/**
6901
+
* The order of the column, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
6902
+
*/
6903
+
"order"?: string;
6904
+
/**
6905
+
* The order of the column for lg screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
6906
+
*/
6907
+
"orderLg"?: string;
6908
+
/**
6909
+
* The order of the column for md screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
6910
+
*/
6911
+
"orderMd"?: string;
6912
+
/**
6913
+
* The order of the column for sm screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
6914
+
*/
6915
+
"orderSm"?: string;
6916
+
/**
6917
+
* The order of the column for xl screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
6918
+
*/
6919
+
"orderXl"?: string;
6920
+
/**
6921
+
* The order of the column for xs screens, in terms of where the column should position itself in the columns renderer. If no value is passed, the column order implicit value will be the order in the html structure.
6922
+
*/
6923
+
"orderXs"?: string;
6864
6924
/**
6865
6925
* The amount to pull the column, in terms of how many columns it should shift to the start of the total available.
6926
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6866
6927
*/
6867
6928
"pull"?: string;
6868
6929
/**
6869
6930
* The amount to pull the column for lg screens, in terms of how many columns it should shift to the start of the total available.
6931
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6870
6932
*/
6871
6933
"pullLg"?: string;
6872
6934
/**
6873
6935
* The amount to pull the column for md screens, in terms of how many columns it should shift to the start of the total available.
6936
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6874
6937
*/
6875
6938
"pullMd"?: string;
6876
6939
/**
6877
6940
* The amount to pull the column for sm screens, in terms of how many columns it should shift to the start of the total available.
6941
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6878
6942
*/
6879
6943
"pullSm"?: string;
6880
6944
/**
6881
6945
* The amount to pull the column for xl screens, in terms of how many columns it should shift to the start of the total available.
6946
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6882
6947
*/
6883
6948
"pullXl"?: string;
6884
6949
/**
6885
6950
* The amount to pull the column for xs screens, in terms of how many columns it should shift to the start of the total available.
6951
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6886
6952
*/
6887
6953
"pullXs"?: string;
6888
6954
/**
6889
6955
* The amount to push the column, in terms of how many columns it should shift to the end of the total available.
6956
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6890
6957
*/
6891
6958
"push"?: string;
6892
6959
/**
6893
6960
* The amount to push the column for lg screens, in terms of how many columns it should shift to the end of the total available.
6961
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6894
6962
*/
6895
6963
"pushLg"?: string;
6896
6964
/**
6897
6965
* The amount to push the column for md screens, in terms of how many columns it should shift to the end of the total available.
6966
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6898
6967
*/
6899
6968
"pushMd"?: string;
6900
6969
/**
6901
6970
* The amount to push the column for sm screens, in terms of how many columns it should shift to the end of the total available.
6971
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6902
6972
*/
6903
6973
"pushSm"?: string;
6904
6974
/**
6905
6975
* The amount to push the column for xl screens, in terms of how many columns it should shift to the end of the total available.
6976
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
6906
6977
*/
6907
6978
"pushXl"?: string;
6908
6979
/**
6909
6980
* The amount to push the column for xs screens, in terms of how many columns it should shift to the end of the total available.
6981
+
* @deprecated Use the combination of `size` and `order` properties to achieve the same effect.
0 commit comments