Skip to content

Commit

Permalink
change(cards): allow rounded, inverted and theme parameter to be set …
Browse files Browse the repository at this point in the history
…by has classes

- these classes are outputted from volto styling mechanism as such we want for
  the cards to behave like cards with the actions set directly on them
  • Loading branch information
ichim-david committed Nov 17, 2022
1 parent 1159b1b commit 4b4ad89
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions theme/themes/eea/views/card.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,13 @@
height: @cardImageHeight;

img {
width: @imageWidth;
height: @imageHeight;
width: var(--card-image-width, @imageWidth);
height: var(--card-image-width, @imageHeight);
object-fit: @imageObjectFit;
object-position: @imageObjectPosition;
}
}

.ui.cards > .card > i.icon,
.ui.cards > .card > a:not(.ui) > i.icon,
.ui.card > i.icon,
.ui.card > a:not(.ui) > i.icon {
color: @iconColor;
}

.ui.cards > .card > .content > *:not(:last-child),
.ui.card > .content > *:not(:last-child) {
Expand Down Expand Up @@ -89,39 +83,44 @@
/*******************************
Primary
*******************************/
.ui.card.primary {
.has--theme--primary .card,
.card.primary {
--card-background-color: @primaryCardBackground;
--card-text-color: @primaryCardColor;
}
/* Inverted */
.ui.card.primary.inverted {
.has--theme--primary.has--inverted--true .card,
.card.primary.inverted {
--card-background-color: @invertedPrimaryCardBackgroundColor;
--card-text-color: @invertedPrimaryCardColor;
}

/*******************************
Secondary
*******************************/

.ui.card.secondary {
.has--theme--secondary .card,
.card.secondary {
--card-background-color: @secondaryCardBackground;
--card-text-color: @secondaryCardColor;
}
/* Inverted */
.ui.card.secondary.inverted {
.has--theme--secondary.has--inverted--true .card,
.card.secondary.inverted {
background-color: @invertedSecondaryCardBackgroundColor;
color: @invertedSecondaryCardColor;
}

/*******************************
Tertiary
*******************************/
.ui.card.tertiary {
.has--theme--tertiary .card,
.card.tertiary {
--card-background-color: @tertiaryCardBackground;
--card-text-color: @tertiaryCardColor;
}
/* Inverted */
.ui.card.tertiary.inverted {
.has--theme--tertiary.has--inverted--true .card,
.card.tertiary.inverted {
--card-background-color: @invertedTertiaryCardBackgroundColor;
--card-text-color: @invertedTertiaryCardColor;
}
Expand All @@ -136,6 +135,10 @@
height: auto;
}

.has--rounded--true .card {
--card-image-width: @roundedImageWidth;
--card-image-height: @roundedImageHeight;
}
.ui.cards .ui.card.rounded,
.has--rounded--true .ui.card,
.ui.card.rounded {
Expand Down Expand Up @@ -373,4 +376,11 @@
.icon {
margin: auto;
}
}
}

.ui.cards > .card > i.icon,
.ui.cards > .card > a:not(.ui) > i.icon,
.ui.card > i.icon,
.ui.card > a:not(.ui) > i.icon {
color: @iconColor;
}

0 comments on commit 4b4ad89

Please sign in to comment.