Commit 3cc0353
feat(grid): modernizing component (#30658)
<!-- 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 <6577830+brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Shane <shane@shanessite.net>1 parent 9f546ed commit 3cc0353
File tree
45 files changed
+498
-85
lines changed- core
- src
- components
- col
- grid/test
- basic
- grid.e2e.ts-snapshots
- offsets-pull-push
- grid.e2e.ts-snapshots
- offsets
- grid.e2e.ts-snapshots
- padding
- grid.e2e.ts-snapshots
- sizes
- grid.e2e.ts-snapshots
- row
- packages
- angular
- src/directives
- standalone/src/directives
- vue/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
45 files changed
+498
-85
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
625 | 631 | | |
626 | 632 | | |
627 | 633 | | |
| |||
641 | 647 | | |
642 | 648 | | |
643 | 649 | | |
| 650 | + | |
644 | 651 | | |
645 | 652 | | |
646 | 653 | | |
| |||
2006 | 2013 | | |
2007 | 2014 | | |
2008 | 2015 | | |
| 2016 | + | |
2009 | 2017 | | |
2010 | 2018 | | |
2011 | 2019 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
930 | 954 | | |
931 | 955 | | |
| 956 | + | |
932 | 957 | | |
933 | 958 | | |
934 | 959 | | |
935 | 960 | | |
| 961 | + | |
936 | 962 | | |
937 | 963 | | |
938 | 964 | | |
939 | 965 | | |
| 966 | + | |
940 | 967 | | |
941 | 968 | | |
942 | 969 | | |
943 | 970 | | |
| 971 | + | |
944 | 972 | | |
945 | 973 | | |
946 | 974 | | |
947 | 975 | | |
| 976 | + | |
948 | 977 | | |
949 | 978 | | |
950 | 979 | | |
951 | 980 | | |
| 981 | + | |
952 | 982 | | |
953 | 983 | | |
954 | 984 | | |
955 | 985 | | |
| 986 | + | |
956 | 987 | | |
957 | 988 | | |
958 | 989 | | |
959 | 990 | | |
| 991 | + | |
960 | 992 | | |
961 | 993 | | |
962 | 994 | | |
963 | 995 | | |
| 996 | + | |
964 | 997 | | |
965 | 998 | | |
966 | 999 | | |
967 | 1000 | | |
| 1001 | + | |
968 | 1002 | | |
969 | 1003 | | |
970 | 1004 | | |
971 | 1005 | | |
| 1006 | + | |
972 | 1007 | | |
973 | 1008 | | |
974 | 1009 | | |
975 | 1010 | | |
| 1011 | + | |
976 | 1012 | | |
977 | 1013 | | |
978 | 1014 | | |
| |||
6861 | 6897 | | |
6862 | 6898 | | |
6863 | 6899 | | |
| 6900 | + | |
| 6901 | + | |
| 6902 | + | |
| 6903 | + | |
| 6904 | + | |
| 6905 | + | |
| 6906 | + | |
| 6907 | + | |
| 6908 | + | |
| 6909 | + | |
| 6910 | + | |
| 6911 | + | |
| 6912 | + | |
| 6913 | + | |
| 6914 | + | |
| 6915 | + | |
| 6916 | + | |
| 6917 | + | |
| 6918 | + | |
| 6919 | + | |
| 6920 | + | |
| 6921 | + | |
| 6922 | + | |
| 6923 | + | |
6864 | 6924 | | |
6865 | 6925 | | |
| 6926 | + | |
6866 | 6927 | | |
6867 | 6928 | | |
6868 | 6929 | | |
6869 | 6930 | | |
| 6931 | + | |
6870 | 6932 | | |
6871 | 6933 | | |
6872 | 6934 | | |
6873 | 6935 | | |
| 6936 | + | |
6874 | 6937 | | |
6875 | 6938 | | |
6876 | 6939 | | |
6877 | 6940 | | |
| 6941 | + | |
6878 | 6942 | | |
6879 | 6943 | | |
6880 | 6944 | | |
6881 | 6945 | | |
| 6946 | + | |
6882 | 6947 | | |
6883 | 6948 | | |
6884 | 6949 | | |
6885 | 6950 | | |
| 6951 | + | |
6886 | 6952 | | |
6887 | 6953 | | |
6888 | 6954 | | |
6889 | 6955 | | |
| 6956 | + | |
6890 | 6957 | | |
6891 | 6958 | | |
6892 | 6959 | | |
6893 | 6960 | | |
| 6961 | + | |
6894 | 6962 | | |
6895 | 6963 | | |
6896 | 6964 | | |
6897 | 6965 | | |
| 6966 | + | |
6898 | 6967 | | |
6899 | 6968 | | |
6900 | 6969 | | |
6901 | 6970 | | |
| 6971 | + | |
6902 | 6972 | | |
6903 | 6973 | | |
6904 | 6974 | | |
6905 | 6975 | | |
| 6976 | + | |
6906 | 6977 | | |
6907 | 6978 | | |
6908 | 6979 | | |
6909 | 6980 | | |
| 6981 | + | |
6910 | 6982 | | |
6911 | 6983 | | |
6912 | 6984 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
| |||
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
23 | | - | |
24 | | - | |
| 30 | + | |
25 | 31 | | |
26 | | - | |
27 | | - | |
28 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
29 | 81 | | |
0 commit comments