diff --git a/projects/igniteui-angular/src/lib/core/styles/components/card/_card-theme.scss b/projects/igniteui-angular/src/lib/core/styles/components/card/_card-theme.scss
index 5325f0e38ae..3fec8e354ca 100644
--- a/projects/igniteui-angular/src/lib/core/styles/components/card/_card-theme.scss
+++ b/projects/igniteui-angular/src/lib/core/styles/components/card/_card-theme.scss
@@ -114,8 +114,6 @@
$not-material-theme: $variant != 'material';
$card-heading-padding: rem(16px, 16px);
- $card-content-padding: rem(16px);
- $card-actions-padding: rem(8px);
$card-tgroup-margin: 0 em(16px);
@@ -159,7 +157,7 @@
%igx-card-header {
display: flex;
flex-flow: row wrap;
- align-content: flex-start;
+ align-items: center;
width: 100%;
padding: $card-heading-padding;
color: var-get($theme, 'header-text-color');
@@ -168,10 +166,6 @@
display: block;
padding: 0;
}
-
- @if $variant == 'fluent' {
- padding: rem(16px) rem(8px);
- }
}
%igx-card-header--vertical {
@@ -195,7 +189,6 @@
}
%igx-card-header-thumbnail {
- align-self: flex-start;
margin-inline-end: rem(16px);
@if $variant == 'indigo' {
@@ -235,7 +228,7 @@
%igx-card-content {
display: block;
width: 100%;
- padding: $card-content-padding;
+ padding: rem(16px);
color: var-get($theme, 'content-text-color');
overflow: auto;
}
@@ -259,6 +252,14 @@
}
%igx-card-actions {
+ $card-actions-padding: map.get((
+ 'material': rem(8px) rem(16px),
+ 'fluent': rem(8px) rem(16px),
+ 'bootstrap': rem(16px),
+ 'indigo': rem(16px),
+ ), $variant);
+
+
display: flex;
flex-flow: row wrap;
justify-content: space-between;
@@ -283,29 +284,26 @@
@if $variant == 'bootstrap' {
%igx-card-content {
- @if $variant == 'bootstrap' {
- padding-block: rem(16px) rem(24px);
- padding-inline: rem(24px);
- }
- }
-
- %igx-card-actions {
- padding: rem(16px);
+ padding-block-end: rem(24px);
}
}
@if $variant == 'indigo' {
- %igx-card-content,
- %igx-card-actions {
- padding: rem(16px);
+ %igx-card-content {
+ padding-block-end: rem(8px);
+ }
+
+ %igx-card-content:last-child {
+ padding-block-end: rem(16px);
}
- %igx-card-content + %igx-card-actions {
- padding-block-start: rem(8px);
+ %igx-card-header {
+ padding-block-end: 0;
}
- %igx-card-header + %igx-card-content {
- padding-block-start: 0;
+ %igx-card-header:last-child,
+ %igx-card-header:first-child {
+ padding-block-end: rem(16px);
}
}
diff --git a/src/app/card/card.sample.html b/src/app/card/card.sample.html
index 9cf9441a603..2ed8ed22b4b 100644
--- a/src/app/card/card.sample.html
+++ b/src/app/card/card.sample.html
@@ -3,8 +3,7 @@
Angular Card
-
-
+
@for(section of sectionOrder; track section) {
@if(section === 'media' && !properties.hideMedia) {
@@ -33,27 +32,27 @@ {{ cards[0].subtitle }}
@if(section === 'actions' && !properties.hideActions) {
+
@for(icon of cards[0].icons; track icon) {
-
- {{icon}}
-
+
+ {{icon}}
+
}
}
}
-
-
-
+
@if(!properties.hideActions) {
-
+
+
@for(icon of cards[1].icons; track icon) {
-
-
-
-
- @if(!properties.hideHeader && !hideTitle) {
- {{cards[1].title}}
- }
- @if(!properties.hideHeader && !hideSubtitle) {
- {{cards[1].subtitle}}
- }
- @if(!properties.hideMedia) {
-
-
-
- }
-
+
+ @if(!properties.hideHeader) {
+
+ @if(!hideTitle) {
+ {{cards[1].title}}
+ }
+ @if(!hideSubtitle) {
+ {{cards[1].subtitle}}
+ }
+ @if(!properties.hideMedia) {
+
+
+
+ }
+
+ }
@if(!properties.hideActions) {
-
+
@for(icon of cards[1].icons; track icon) {
}
-
-
-
+
-
-
- {{ cards[2].title }}
- {{ cards[2].subtitle }}
-
-
- @for(button of cards[2].buttons; track button){
-
- }
-
+ @if(!properties.hideHeader) {
+
+ @if(!hideThumbnail) {
+
+ }
+
+ @if(!hideTitle) {
+ {{ cards[2].title }}
+ }
+
+ @if(!hideSubtitle) {
+ {{ cards[2].subtitle }}
+ }
+
+ }
+
+ @if(!properties.hideActions) {
+
+ @for(button of cards[2].buttons; track button){
+
+ }
+
+ }
-
+ @if(!properties.hideMedia) {
+
+ }
-
@@ -166,8 +177,7 @@ {{ cards[2].subtitle }}
WC Card
-
-
+
@for(section of sectionOrder; track section) {
@if(section === 'media' && !properties.hideMedia) {
@@ -217,11 +227,9 @@ WC Card
}
-
-
-
+
@if(!properties.hideActions) {
@for(icon of cards[1].icons; track icon) {
@@ -256,30 +264,38 @@ WC Card
}
-
-
-
-
-
- @if(!properties.hideMedia) {
-
-
-
- }
- @if(!properties.hideHeader) { @if(!hideTitle) {
- {{cards[1].title}}
- }
- @if(!hideSubtitle) {
- {{cards[1].subtitle}}
+
+
+
+ @if(!properties.hideHeader) {
+
+ @if(!properties.hideMedia) {
+
+
+
+
+
+ }
+
+ @if(!properties.hideHeader) { @if(!hideTitle) {
+ {{cards[1].title}}
+ }
+ @if(!hideSubtitle) {
+ {{cards[1].subtitle}}
+ }
+ }
+
}
- }
-
+
+
@if(!properties.hideActions) {
-
+
@for(icon of cards[1].icons; track icon) {
}
-
-
-
+
WC Card
flex: 1 1 auto;
"
>
-
-
- {{ cards[2].title }}
- {{ cards[2].subtitle }}
-
+ @if(!properties.hideHeader) {
+
+ @if(!hideThumbnail) {
+
+ }
+ @if(!hideTitle) {
+ {{ cards[2].title }}
+ }
-
+ @if(!hideSubtitle) {
+ {{ cards[2].subtitle }}
+ }
+
+ }
+
+ @if(!properties.hideActions) {
+
@for(button of cards[2].buttons; track button){
{{ button }}
}
+ }
-
-
-
+ @if(!properties.hideMedia) {
+
+
+
+ }
-
diff --git a/src/app/card/card.sample.scss b/src/app/card/card.sample.scss
index d16b00ad973..20d5693a185 100644
--- a/src/app/card/card.sample.scss
+++ b/src/app/card/card.sample.scss
@@ -1,29 +1,42 @@
.cards-wrapper {
display: grid;
- grid-template-columns: repeat(2, 1fr);
+ grid-template-columns: repeat(2, minmax(340px, 1fr));
justify-items: center;
padding-block-start: 2rem;
+ gap: 1rem;
}
-.angular-cards, .wc-cards {
- justify-items: center;
+.angular-cards,
+.wc-cards {
display: grid;
- grid-auto-flow: row;
- grid-template-rows: subgrid;
- grid-row: span 5;
gap: 1rem;
+ grid-row: 1;
}
-.card {
- min-width: 320px;
- max-width: 320px;
- h4 {
- margin-bottom: 1rem;
- }
+.angular-cards:dir(rtl) {
+ grid-column: 2;
+}
+
+.wc-cards:dir(rtl) {
+ grid-column: 1;
}
+
.custom-controls {
display: grid;
gap: 1rem;
}
+
+#igniteui-demo-app .sample-title {
+ margin-bottom: 0;
+ justify-self: center;
+}
+
+#igniteui-demo-app .sample-wrapper {
+ height: auto;
+}
+
+#igniteui-demo-app .content {
+ padding-bottom: 1rem;
+}
diff --git a/src/app/card/card.sample.ts b/src/app/card/card.sample.ts
index b544e8d3f23..629acf4db5c 100644
--- a/src/app/card/card.sample.ts
+++ b/src/app/card/card.sample.ts
@@ -152,6 +152,13 @@ export class CardSampleComponent implements OnInit {
defaultValue: false
}
},
+ justifyActions: {
+ label: 'Justify actions(Angular Only)',
+ control: {
+ type: 'boolean',
+ defaultValue: true
+ }
+ },
};
public properties: Properties;