Skip to content

Commit c2c0001

Browse files
author
cchaos
committed
Fixing up docs
1 parent 785691a commit c2c0001

File tree

2 files changed

+45
-25
lines changed

2 files changed

+45
-25
lines changed

src-docs/src/views/card/card_example.js

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ export const CardExample = {
6262
<p>
6363
By default a card&apos;s title element is a <EuiCode>span</EuiCode>.
6464
This can be changed via the <EuiCode>titleElement</EuiCode> prop.
65-
However, if an <EuiCode>onClick</EuiCode> function is also passed,
66-
the title element will be forced back to a span.
65+
However, it will always remain the same visual size.
6766
</p>
6867
<p>
6968
By default a card&apos;s content is center aligned. To change the
@@ -116,6 +115,13 @@ export const CardExample = {
116115
),
117116
props: { EuiCard },
118117
demo: <CardLayout />,
118+
snippet: `<EuiCard
119+
layout="horizontal"
120+
icon={<EuiIcon size="xl" type={} />}
121+
title=""
122+
description=""
123+
onClick={}
124+
/>`,
119125
},
120126
{
121127
title: 'Images',
@@ -148,6 +154,13 @@ export const CardExample = {
148154
),
149155
props: { EuiCard },
150156
demo: <CardImage />,
157+
snippet: `<EuiCard
158+
textAlign="left"
159+
image="https://source.unsplash.com/400x200/?Nature"
160+
title=""
161+
description=""
162+
onClick={}
163+
/>`,
151164
},
152165
{
153166
title: 'Footer',
@@ -181,16 +194,16 @@ export const CardExample = {
181194
components: { EuiCard },
182195
demo: <CardFooter />,
183196
snippet: `<EuiCard
184-
icon={<EuiIcon size="xxl" type="devToolsApp" />}
185-
title="Developers Tools"
186-
description="Example of a short card description."
197+
icon={<EuiIcon size="xxl" type="" />}
198+
title=""
199+
description=""
187200
footer={
188201
<div>
189-
<EuiButton aria-label="Go to Developers Tools">Go for it</EuiButton>
202+
<EuiButton aria-label=""></EuiButton>
190203
<EuiSpacer size="xs" />
191204
<EuiText size="s">
192205
<p>
193-
Or try <EuiLink href="http://google.com">this</EuiLink>
206+
Or try <EuiLink href="">this</EuiLink>
194207
</p>
195208
</EuiText>
196209
</div>
@@ -221,6 +234,14 @@ export const CardExample = {
221234
),
222235
props: { EuiCard },
223236
demo: <CardBeta />,
237+
snippet: `<EuiCard
238+
icon={<EuiIcon size="xxl" type={} />}
239+
title=""
240+
description=""
241+
onClick={}
242+
betaBadgeLabel=""
243+
betaBadgeTooltipContent=""
244+
/>`,
224245
},
225246
{
226247
title: 'Selectable',
@@ -247,34 +268,28 @@ export const CardExample = {
247268
</p>
248269
<EuiCallOut
249270
color="warning"
250-
title="Stop propagation of click event on internal buttons/links">
251-
<p>
252-
When providing an extra link to more details or such, be sure to
253-
stop event propagation from also selecting the card.
254-
</p>
255-
</EuiCallOut>
271+
title="When providing an extra link to more details or such, be sure to
272+
stop event propagation from also selecting the card."
273+
/>
256274
</Fragment>
257275
),
258276
props: { EuiCardSelect },
259277
demo: <CardSelectable />,
260278
snippet: `<EuiCard
261279
icon={<EuiIcon />}
262-
title="Title"
263-
description="Example of a short card description."
280+
title=""
281+
description=""
264282
selectable={{
265283
onClick: this.cardClicked,
266284
isSelected: this.state.cardIsSelected,
267285
isDisabled: this.state.cardIsDisabled,
268286
}}
269287
footer={<EuiButtonEmpty
270-
iconType="iInCircle"
271-
size="xs"
272288
onClick={e => {
273289
e.stopPropagation();
274290
}}
275-
aria-label="See more details about Title">
276-
More details
277-
</EuiButtonEmpty>}
291+
aria-label=""
292+
/>}
278293
/>`,
279294
},
280295
{
@@ -302,8 +317,8 @@ export const CardExample = {
302317
demo: <CardChildren />,
303318
snippet: `<EuiCard
304319
textAlign="left"
305-
title="Lists"
306-
description="Lists are cool">
320+
title=""
321+
description="">
307322
<EuiText size="s">
308323
<ul>
309324
<li>Bullet 1</li>

src/components/card/_card.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,14 @@
158158
}
159159
}
160160

161-
.euiCard__footer:not(:empty) {
162-
flex-grow: 0; /* 1 */
163-
margin-top: $euiCardSpacing;
161+
.euiCard__footer {
162+
// Ensure it always stretches no matter the flex layout
163+
width: 100%;
164+
165+
&:not(:empty) {
166+
flex-grow: 0; /* 1 */
167+
margin-top: $euiCardSpacing;
168+
}
164169
}
165170

166171
.euiCard.euiCard--horizontal {

0 commit comments

Comments
 (0)