packages/core/styles/components/card.pcss (43 lines of code) (raw):
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
:root {
--ifm-card-background-color: var(--ifm-background-surface-color);
--ifm-card-border-radius: calc(var(--ifm-global-radius) * 2);
--ifm-card-horizontal-spacing: var(--ifm-global-spacing);
--ifm-card-vertical-spacing: var(--ifm-global-spacing);
}
.card {
background-color: var(--ifm-card-background-color);
border-radius: var(--ifm-card-border-radius);
box-shadow: var(--ifm-global-shadow-lw);
display: flex;
flex-direction: column;
overflow: hidden; /* Because of border-radius. */
&--full-height {
height: 100%;
}
&__image {
padding-top: var(--ifm-card-vertical-spacing);
&:first-child {
padding-top: 0;
}
}
&__header,
&__body,
&__footer {
padding: var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing);
&:not(:last-child) {
padding-bottom: 0;
}
& > :last-child {
margin-bottom: 0;
}
}
&__footer {
margin-top: auto; /* Pushes the footer to the bottom of the card. */
}
}