Skip to content

Commit

Permalink
change(card): added image card section, tweaked mobile heading size
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david committed Jan 23, 2023
1 parent b83d982 commit 0f879e1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
33 changes: 33 additions & 0 deletions src/ui/Card/Card.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,39 @@ CardGrid.args = {
],
};

export const ImageGrid = GridTemplate.bind({});
ImageGrid.args = {
titleOnImage: true,
variant: 'default',
inverted: false,
cards: [
{
title: 'Nature',
imgUrl:
'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
hasImage: true,
href: '/#',
fluid: true,
},
{
title: 'Economy and resources',
imgUrl:
'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
hasImage: true,
href: '/#',
fluid: true,
},
{
title: "State of Europe's environment",
imgUrl:
'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
hasImage: true,
href: '/#',
fluid: true,
},
],
};

const FluidGridTemplate = (args) => (
<Container>
<div className="fluid-card-row">
Expand Down
5 changes: 2 additions & 3 deletions theme/themes/eea/views/card.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -276,19 +276,18 @@
}

.gradient .header {
font-size: var(--image-header-font-size, @imageTitleFontSize);
font-size: var(--image-header-font-size, @imageTitleMobileFontSize);
color: @imageTitleColor;
font-weight: @imageTitleFontWeight;
line-height: @imageTitleLineHeight;
text-transform: @imageTitleTextTransform;
}

@media only screen and (min-width: @tabletBreakpoint) {
.card .gradient {
padding-block: @imageTitlePaddingBlock;
}
.gradient .header {
--image-header-font-size: @font-size-7;
--image-header-font-size: @imageTitleFontSize;
}
}

Expand Down
4 changes: 2 additions & 2 deletions theme/themes/eea/views/card.variables
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@
Image with title
*******************************/
@imageTitleColor: @white;
@imageTitleFontSize: @font-size-4;
@imageTitleFontSize: @h2;
@imageTitleMobileFontSize: @mobileH1;
@imageTitleFontWeight: @font-weight-7;
@imageTitleLineHeight: @font-lineheight-0;
@imageTitlePadding: @rem-space-6;
@imageTitlePaddingBlock: @rem-space-2;
@imageTitleTextTransform: none;

/*******************************
Rounded Card
Expand Down

0 comments on commit 0f879e1

Please sign in to comment.