Skip to content

Commit 210f724

Browse files
BenOsodracbrandyscarneyIonitron
authored
feat(card): add ionic theme tokens, update design (#29757)
## What is the new behavior? - Reviewed tokens used for `ion-card` on Ionic Theme. - Removed border on ion-card. - Changed default shape to round. - Added ionic theme partials for `ion-title`, `ion-subtitle`, `ion-header` and `ion-content`. ## Other information [Sample Screen](https://ionic-framework-hyyi9k1ti-ionic1.vercel.app/src/components/card/test/theme-ionic) --------- Co-authored-by: Brandy Carney <[email protected]> Co-authored-by: ionitron <[email protected]>
1 parent 8fb8136 commit 210f724

39 files changed

+179
-73
lines changed

core/api.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,13 @@ ion-card,prop,shape,"rectangular" | "round" | "soft" | undefined,'round',false,t
465465
ion-card,prop,target,string | undefined,undefined,false,false
466466
ion-card,prop,theme,"ios" | "md" | "ionic",undefined,false,false
467467
ion-card,prop,type,"button" | "reset" | "submit",'button',false,false
468+
ion-card,css-prop,--background,ionic
468469
ion-card,css-prop,--background,ios
469470
ion-card,css-prop,--background,md
471+
ion-card,css-prop,--border-radius,ionic
470472
ion-card,css-prop,--border-radius,ios
471473
ion-card,css-prop,--border-radius,md
474+
ion-card,css-prop,--color,ionic
472475
ion-card,css-prop,--color,ios
473476
ion-card,css-prop,--color,md
474477
ion-card,part,native
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Card Content
2+
// --------------------------------------------------
3+
4+
ion-card-content {
5+
position: relative;
6+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@use "./card-content.common.scss";
2+
@use "../../themes/ionic/ionic.globals.scss" as globals;
3+
4+
// Ionic Card Content
5+
// --------------------------------------------------
6+
7+
.card-content-ionic {
8+
@include globals.padding(globals.$ionic-space-400);
9+
10+
display: flex;
11+
12+
flex-direction: column;
13+
14+
font-size: globals.$ionic-font-size-350;
15+
16+
line-height: globals.$ionic-line-height-600;
17+
18+
gap: globals.$ionic-space-200;
19+
20+
img {
21+
@include globals.margin(globals.$ionic-space-200, 0, globals.$ionic-space-200, 0);
22+
}
23+
}
24+
25+
ion-card-header + .card-content-ionic {
26+
padding-top: 0;
27+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "./card-content";
1+
@import "./card-content.native";
22
@import "./card-content.ios.vars";
33

44
// iOS Card Header

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "./card-content";
1+
@import "./card-content.native";
22
@import "./card-content.md.vars";
33

44
// Material Design Card Content
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
@use "./card-content.common.scss";
12
@import "../../themes/native/native.globals";
23

34
// Card Content
45
// --------------------------------------------------
56

67
ion-card-content {
78
display: block;
8-
position: relative;
99
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { getIonTheme } from '../../global/ionic-global';
1212
styleUrls: {
1313
ios: 'card-content.ios.scss',
1414
md: 'card-content.md.scss',
15-
ionic: 'card-content.md.scss',
15+
ionic: 'card-content.ionic.scss',
1616
},
1717
})
1818
export class CardContent implements ComponentInterface {

core/src/components/card-header/card-header.scss renamed to core/src/components/card-header/card-header.common.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../../themes/native/native.globals";
1+
@use "../../themes/functions.color" as color;
22

33
// Card Header
44
// --------------------------------------------------
@@ -17,6 +17,6 @@
1717
}
1818

1919
:host(.ion-color) {
20-
background: current-color(base);
21-
color: current-color(contrast);
20+
background: color.current-color(base);
21+
color: color.current-color(contrast);
2222
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@use "./card-header.common";
2+
@use "../../themes/ionic/ionic.globals.scss" as globals;
3+
4+
// Ionic Card Header
5+
// --------------------------------------------------
6+
7+
:host {
8+
@include globals.padding(globals.$ionic-space-400);
9+
gap: globals.$ionic-space-050;
10+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@import "./card-header";
1+
@import "./card-header.common";
2+
@import "../../themes/native/native.globals";
23
@import "./card-header.ios.vars";
34

45
// iOS Card Header

0 commit comments

Comments
 (0)