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
feat(card): convert card-content to shadow DOM (#30759)
Issue number: internal
---------
## What is the current behavior?
Card content has no encapsulation.
## What is the new behavior?
Converted `ion-card-content` to Shadow DOM which improves consistency among components & CSP compatibility.
## Does this introduce a breaking change?
- [x] Yes
- [ ] No
BREAKING CHANGE:
The `ion-card-content` component has been updated to Shadow DOM. With this update, all card-related components now use Shadow DOM for style encapsulation. There should not be any breaking changes related to targeting inner elements since `ion-card-content` does not have any internal elements of its own. However, some user styles may break due to the removal of the `card-content-{mode}` class or changes in selector specificity.
The default styles for heading elements inside `ion-card-content` have been removed. If you need custom styling for headings, you can add your own CSS targeting these elements.
For example:
```css
ion-card-content h1 {
margin-top: 0;
margin-bottom: 2px;
font-size: 1.5rem;
}
ion-card-content h2 {
margin-top: 2px;
margin-bottom: 2px;
font-size: 1rem;
}
ion-card-content h3,
ion-card-content h4,
ion-card-content h5,
ion-card-content h6 {
margin-top: 2px;
margin-bottom: 2px;
font-size: 0.875rem;
}
```
---------
Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
Copy file name to clipboardExpand all lines: BREAKING.md
+44-2Lines changed: 44 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,35 @@ This is a comprehensive list of the breaking changes introduced in the major ver
28
28
29
29
<h4id="version-9x-card">Card</h4>
30
30
31
-
- The `border-radius` of the `ios` and `md` card now defaults to `14px` and `12px` instead of `8px` and `4px`, respectively, in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"soft"`, or override the `--border-radius` CSS variable to specify a different value.
31
+
-**ion-card**: The `border-radius` of the `ios` and `md` card now defaults to `14px` and `12px` instead of `8px` and `4px`, respectively, in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"soft"`, or override the `--border-radius` CSS variable to specify a different value.
32
+
33
+
-**ion-card-content**: The `ion-card-content` component has been updated to Shadow DOM. With this update, all card-related components now use Shadow DOM for style encapsulation. The default styles for heading elements inside `ion-card-content` have been removed. If you need custom styling for headings, you can add your own CSS targeting these elements. For example:
34
+
35
+
```css
36
+
ion-card-contenth1 {
37
+
margin-top: 0;
38
+
margin-bottom: 2px;
39
+
40
+
font-size: 1.5rem;
41
+
}
42
+
43
+
ion-card-contenth2 {
44
+
margin-top: 2px;
45
+
margin-bottom: 2px;
46
+
47
+
font-size: 1rem;
48
+
}
49
+
50
+
ion-card-contenth3,
51
+
ion-card-contenth4,
52
+
ion-card-contenth5,
53
+
ion-card-contenth6 {
54
+
margin-top: 2px;
55
+
margin-bottom: 2px;
56
+
57
+
font-size: 0.875rem;
58
+
}
59
+
```
32
60
33
61
<h4id="version-9x-chip">Chip</h4>
34
62
@@ -47,6 +75,7 @@ Additionally, the `radio-group-wrapper` div element has been removed, causing sl
47
75
<h5>Example 1: Swap two columns</h5>
48
76
49
77
**Version up to 8.x**
78
+
50
79
```html
51
80
<ion-grid>
52
81
<ion-row>
@@ -56,7 +85,9 @@ Additionally, the `radio-group-wrapper` div element has been removed, causing sl
56
85
</ion-row>
57
86
</ion-grid>
58
87
```
88
+
59
89
**Version 9.x+**
90
+
60
91
```html
61
92
<ion-grid>
62
93
<ion-row>
@@ -68,9 +99,11 @@ Additionally, the `radio-group-wrapper` div element has been removed, causing sl
68
99
```
69
100
70
101
<h5>Example 2: Reorder columns with specific sizes</h5>
102
+
71
103
To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `size="3" pull="9"`:
72
104
73
105
**Version up to 8.x**
106
+
74
107
```html
75
108
<ion-grid>
76
109
<ion-row>
@@ -79,7 +112,9 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `
79
112
</ion-row>
80
113
</ion-grid>
81
114
```
115
+
82
116
**Version 9.x+**
117
+
83
118
```html
84
119
<ion-grid>
85
120
<ion-row>
@@ -88,7 +123,9 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `
88
123
</ion-row>
89
124
</ion-grid>
90
125
```
126
+
91
127
<h5>Example 3: Push</h5>
128
+
92
129
```html
93
130
<ion-grid>
94
131
<ion-row>
@@ -101,7 +138,9 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `
101
138
</ion-row>
102
139
</ion-grid>
103
140
```
141
+
104
142
**Version 9.x+**
143
+
105
144
```html
106
145
<ion-grid>
107
146
<ion-row>
@@ -116,6 +155,7 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `
116
155
```
117
156
118
157
<h5>Example 4: Push and Pull</h5>
158
+
119
159
```html
120
160
<ion-grid>
121
161
<ion-row>
@@ -128,7 +168,9 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `
128
168
</ion-row>
129
169
</ion-grid>
130
170
```
171
+
131
172
**Version 9.x+**
173
+
132
174
```html
133
175
<ion-grid>
134
176
<ion-row>
@@ -140,4 +182,4 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `
0 commit comments