Skip to content

Commit 53a795d

Browse files
committed
feat(card): convert card-content to shadow DOM
1 parent d19f061 commit 53a795d

File tree

8 files changed

+15
-23
lines changed

8 files changed

+15
-23
lines changed

core/api.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ ion-alert,css-prop,--width,ionic
179179
ion-alert,css-prop,--width,ios
180180
ion-alert,css-prop,--width,md
181181

182-
ion-app,none
182+
ion-app,shadow
183183
ion-app,prop,mode,"ios" | "md",undefined,false,false
184184
ion-app,prop,theme,"ios" | "md" | "ionic",undefined,false,false
185185
ion-app,method,setFocus,setFocus(elements: HTMLElement[]) => Promise<void>
@@ -504,7 +504,7 @@ ion-card,css-prop,--color,ios
504504
ion-card,css-prop,--color,md
505505
ion-card,part,native
506506

507-
ion-card-content,none
507+
ion-card-content,shadow
508508
ion-card-content,prop,mode,"ios" | "md",undefined,false,false
509509
ion-card-content,prop,theme,"ios" | "md" | "ionic",undefined,false,false
510510

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Card Content
22
// --------------------------------------------------
33

4-
ion-card-content {
4+
:host {
55
position: relative;
66
}

core/src/components/card-content/card-content.ionic.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Ionic Card Content
55
// --------------------------------------------------
66

7-
.card-content-ionic {
7+
:host {
88
@include globals.padding(globals.$ion-space-400);
99
@include globals.typography(globals.$ion-body-md-regular);
1010

@@ -18,7 +18,3 @@
1818
@include globals.margin(globals.$ion-space-200, 0, globals.$ion-space-200, 0);
1919
}
2020
}
21-
22-
ion-card-header + .card-content-ionic {
23-
padding-top: 0;
24-
}

core/src/components/card-content/card-content.ios.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// iOS Card Header
55
// --------------------------------------------------
66

7-
.card-content-ios {
7+
:host {
88
@include padding($card-ios-padding-top, $card-ios-padding-end, $card-ios-padding-bottom, $card-ios-padding-start);
99

1010
font-size: $card-ios-font-size;
@@ -41,7 +41,3 @@
4141
font-size: dynamic-font(14px);
4242
}
4343
}
44-
45-
ion-card-header + .card-content-ios {
46-
padding-top: 0;
47-
}

core/src/components/card-content/card-content.md.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Material Design Card Content
55
// --------------------------------------------------
66

7-
.card-content-md {
7+
:host {
88
@include padding($card-md-padding-top, $card-md-padding-end, $card-md-padding-bottom, $card-md-padding-start);
99

1010
font-size: $card-md-font-size;
@@ -44,7 +44,3 @@
4444
line-height: 1.5;
4545
}
4646
}
47-
48-
ion-card-header + .card-content-md {
49-
padding-top: 0;
50-
}

core/src/components/card-content/card-content.native.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
// Card Content
55
// --------------------------------------------------
66

7-
ion-card-content {
7+
:host {
88
display: block;
99
}

core/src/components/card-content/card-content.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { getIonTheme } from '../../global/ionic-global';
1414
md: 'card-content.md.scss',
1515
ionic: 'card-content.ionic.scss',
1616
},
17+
shadow: true,
1718
})
1819
export class CardContent implements ComponentInterface {
1920
render() {
@@ -22,11 +23,10 @@ export class CardContent implements ComponentInterface {
2223
<Host
2324
class={{
2425
[theme]: true,
25-
26-
// Used internally for styling
27-
[`card-content-${theme}`]: true,
2826
}}
29-
></Host>
27+
>
28+
<slot></slot>
29+
</Host>
3030
);
3131
}
3232
}

core/src/css/core.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,3 +424,7 @@ h1[tabindex="-1"]:focus,
424424
overflow: hidden;
425425
}
426426
}
427+
428+
ion-card-header + ion-card-content {
429+
padding-top: 0;
430+
}

0 commit comments

Comments
 (0)