Skip to content

Commit

Permalink
fix: ImageCard spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Frincu authored and Filip Frincu committed Aug 27, 2020
1 parent 8dca154 commit 5d417b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
17 changes: 10 additions & 7 deletions packages/gatsby-theme-carbon/src/components/ImageCard/ImageCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ export default class ImageCard extends React.Component {
[`${prefix}--image-card--dark`]: hoverColor === 'dark',
});

const aspectRatioClassNames = classnames([`${prefix}--aspect-ratio`], {
[`${prefix}--aspect-ratio--2x1`]: aspectRatio === '2:1',
[`${prefix}--aspect-ratio--1x2`]: aspectRatio === '1:2',
[`${prefix}--aspect-ratio--1x1`]: aspectRatio === '1:1',
[`${prefix}--aspect-ratio--16x9`]: aspectRatio === '16:9',
[`${prefix}--aspect-ratio--4x3`]: aspectRatio === '4:3',
});
const aspectRatioClassNames = classnames(
[`${prefix}--aspect-ratio`, `${prefix}--image-card__spacing`],
{
[`${prefix}--aspect-ratio--2x1`]: aspectRatio === '2:1',
[`${prefix}--aspect-ratio--1x2`]: aspectRatio === '1:2',
[`${prefix}--aspect-ratio--1x1`]: aspectRatio === '1:1',
[`${prefix}--aspect-ratio--16x9`]: aspectRatio === '16:9',
[`${prefix}--aspect-ratio--4x3`]: aspectRatio === '4:3',
}
);

const carbonTileclassNames = classnames([`${prefix}--tile`], {
[`${prefix}--tile--clickable`]: href !== undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@
width: 100%;
height: 100%;
max-width: 100% !important;
top: -1px;
left: 0px;

@include carbon--breakpoint('md') {
left: -1px;
}
}

.#{$prefix}--image-card__img:after {
Expand All @@ -105,6 +99,15 @@
transition: opacity $duration--fast-01;
}

.#{$prefix}--image-card__spacing {
margin-right: 1px;
margin-bottom: 1px;

@include carbon--breakpoint-down('md') {
margin-right: 0px;
}
}

.#{$prefix}--image-card
.#{$prefix}--tile:hover
.#{$prefix}--image-card__img:after {
Expand Down

0 comments on commit 5d417b9

Please sign in to comment.