Skip to content

Commit

Permalink
make card with image work when paddingSize is none
Browse files Browse the repository at this point in the history
  • Loading branch information
andreadelrio committed Jun 23, 2020
1 parent 7d90d11 commit 652dac6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src-docs/src/views/card/card_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default () => (
<EuiCard
textAlign="left"
href="https://elastic.github.io/eui/"
paddingSize="none"
image="https://source.unsplash.com/400x200/?City"
icon={<EuiIcon size="xxl" type="logoBeats" />}
title={'Beats in the City'}
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
// This creates a bunch of sub selectors for the beta badge
@include euiHasBetaBadge($selector: '.euiCard', $spacing: $euiCardSpacing);

@each $modifier, $paddingAmount in $euiPanelPaddingModifiers {
@each $modifier, $paddingAmount in $euiCardPaddingModifiers {
.euiCard--#{$modifier} {
padding: $paddingAmount;

Expand Down
2 changes: 1 addition & 1 deletion src/components/card/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export type EuiCardProps = Omit<CommonProps, 'aria-label'> & {
};

const paddingSizeToClassNameMap = {
none: null,
none: 'euiCard--paddingNone',
s: 'euiCard--paddingSmall',
m: 'euiCard--paddingMedium',
l: 'euiCard--paddingLarge',
Expand Down
6 changes: 6 additions & 0 deletions src/global_styling/variables/_card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$euiCardPaddingModifiers: (
'paddingNone': 0,
'paddingSmall': $euiSizeS,
'paddingMedium': $euiSize,
'paddingLarge': $euiSizeL
) !default;
1 change: 1 addition & 0 deletions src/global_styling/variables/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
@import 'form';
@import 'header';
@import 'panel';
@import 'card';
@import 'tool_tip';

0 comments on commit 652dac6

Please sign in to comment.