No notes defined.
<div class="card">
<div class="card__flag">
<h3 class="h6 strong">
Card Title
</h3>
</div>
<div class="card__flex">
<figure class="card__figure card__figure--icon" aria-hidden="true">
<div class="card__figureFrame">
<i class="icon">
<svg width="10" height="14" viewBox="0 0 10 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.5 0H1.5C1.23478 0 0.98043 0.105357 0.792893 0.292893C0.605357 0.48043 0.5 0.734784 0.5 1V13C0.5 13.2652 0.605357 13.5196 0.792893 13.7071C0.98043 13.8946 1.23478 14 1.5 14H8.5C8.76522 14 9.01957 13.8946 9.20711 13.7071C9.39464 13.5196 9.5 13.2652 9.5 13V1C9.5 0.734784 9.39464 0.48043 9.20711 0.292893C9.01957 0.105357 8.76522 0 8.5 0ZM5.5 13H4.5V12H5.5V13ZM1.5 11V1H8.5V11H1.5Z" fill="neutral-primary" />
</svg>
</i>
</div>
</figure>
<div class="card__content">
<div class="h5 card__title">
<a href="" class="pointyLink link--stretched-before">
The Resources of U-M, A Top Academic and Research Institution
</a>
</div>
<div class="card__description">
<p>MSW student representatives will be available to share information about the University of Michigan's MSW and PhD programs!</p>
</div>
</div>
</div>
</div>
{% set titleElement = titleElement ?: 'h3' %}
<div class="card">
{% if flagText %}
<div class="card__flag">
<{{ titleElement }} class="h6 strong">
{{ flagText }}
</{{ titleElement }}>
</div>
{% endif %}
<div class="card__flex">
{% if icon %}
<figure class="card__figure card__figure--icon" aria-hidden="true">
<div class="card__figureFrame{{ figureFrameBackground ? ' card__figureFrame--' ~ figureFrameBackground }}">
<i class="icon">
{% include '@icon' with {
icon: icon,
fill: iconFill ?: 'neutral-primary'
} %}
</i>
</div>
</figure>
{% endif %}
<div class="card__content">
<div class="h5 card__title">
{% if link %}
<a href="" class="pointyLink link--stretched-before">
{% endif %}
{{ title ?: random([placeholderTitle, placeholderTitle2, placeholderTitle3, placeholderTitle4]) }}
{% if link %}
</a>
{% endif %}
</div>
{% if description %}
<div class="card__description">
{{ description }}
</div>
{% endif %}
</div>
</div>
</div>
.card {
$card__internal-spacing: $spacing-xs;
$card__internal-padding: calc($spacing-2xs + $spacing-multiplier);
--accent: #{$secondary};
--accent-contrast: #{choose-contrast-color-prefer-white($secondary)};
position: relative;
margin-bottom: $spacing-xl;
@include typescale('sm');
border-left: $border-accent-width solid;
border-image:
linear-gradient(
to bottom,
var(--accent) 50%,
rgba(white, 0)
) 1 100%;
&__flag {
display: inline-block;
margin-bottom: calc($spacing-2xs + math.div($spacing-multiplier, 4));
background: var(--accent);
color: var(--accent-contrast);
padding: $spacing-4xs $spacing-sm $spacing-4xs $card__internal-padding;
> * {
margin: 0;
}
}
&__flex {
display: flex;
flex-direction: row-reverse;
flex-wrap: wrap;
column-gap: $spacing-sm;
padding-top: calc($spacing-2xs + math.div($spacing-multiplier, 4));
}
&__figure {
flex: 3 99 17.5%;
margin: 0 0 $card__internal-padding;
padding: 0 0 0 $card__internal-padding;
img {
border-bottom-right-radius: $border-radius-lg;
aspect-ratio: 2 / 1;
height: 100%;
width: 100%;
object-fit: cover;
}
&--uncropped {
img {
width: auto;
height: auto;
max-height: 90vh;
margin-left: auto;
margin-right: auto;
aspect-ratio: auto;
}
}
&--shadow {
img {
box-shadow: 0 0 $border-accent-width rgba($grey--borders, 0.75);
}
}
&--icon {
.card__figureFrame {
padding: calc(5% + #{$spacing-lg}) 5%;
border-bottom-right-radius: $border-radius-lg;
}
}
}
&__figureFrame {
background: linear-gradient(to bottom, $offwhite, rgba(white, 0));
padding: 5%;
box-sizing: border-box;
text-align: center;
img, svg {
max-width: 100%;
box-sizing: border-box;
margin: auto;
}
.icon {
font-size: 5em;
svg, path {
fill: var(--svg-fill, $neutral--primary);
}
}
&--primary {
--svg-fill: white;
background: linear-gradient(to bottom, $primary, lighten($primary, 15%));
}
&--secondary {
--svg-fill: white;
background: linear-gradient(to bottom, $secondary, lighten($secondary, 15%));
}
&--tertiary {
--svg-fill: white;
background: linear-gradient(to bottom, $tertiary, lighten($tertiary, 15%));
}
&--neutral {
--svg-fill: white;
background: linear-gradient(to bottom, $neutral--primary, lighten($neutral--primary, 15%));
}
}
&__img {
&--bordered {
border: $border-accent-width solid $offwhite;
}
&--no-radius {
border-radius: 0 !important;
}
}
&__imageGrid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 2.5%;
aspect-ratio: 2 / 1;
img {
aspect-ratio: auto;
width: auto;
height: auto;
}
}
&__imgPlaceholder {
background: $offwhite;
border-bottom-right-radius: $border-radius-lg;
}
&__videoShort {
@include video-container('portrait');
border-bottom-right-radius: $border-radius-lg;
}
&__icon {
flex: 1 99 1em;
margin: 0 0 $card__internal-padding;
display: inline-flex;
align-self: flex-start;
align-items: center;
justify-content: center;
text-align: center;
.icon {
font-size: 1.5em;
background: $neutral--primary;
border-radius: 100%;
padding: 0.35em;
svg, path {
fill: var(--svg-fill, white);
}
&--bg-primary {
background: $primary;
}
&--bg-secondary {
background: $secondary;
}
&--bg-tertiary {
background: $tertiary;
}
}
}
&__content {
flex: 99 1 30rem;
padding: 0 $card__internal-padding $card__internal-padding;
}
&__title {
margin: 0 0 $card__internal-spacing;
font-weight: bold;
&--light {
font-weight: normal;
}
}
&__description,
:where(p) {
margin-bottom: $card__internal-spacing;
}
&__quote {
margin: 0 0 $spacing-md;
@include typescale('md');
}
&__section {
.card__flex {
flex-direction: row;
column-gap: $grid-gutter-large;
}
&Title {
margin: $spacing-lg 0 $spacing-sm;
padding: $spacing-xs 0;
border-top: 1px solid $grey--borders;
border-bottom: 1px solid $grey--borders;
border-image:
linear-gradient(
to right,
#{$grey--borders},
rgba(white, 0)
) 1;
}
}
&__meta {
flex: 99 1 30rem;
align-self: flex-start;
margin-top: $spacing-sm;
margin-bottom: $card__internal-spacing;
@include typescale('xs');
color: var(--text-color, $grey--mid-dark);
a {
color: $grey--mid-dark;
}
> *:where(p, ul, dl) {
margin-bottom: $spacing-sm;
}
> *:last-child {
margin-bottom: 0;
}
}
&__actions {
flex: 1 1 10rem;
margin-top: $spacing-md;
}
.pointyLink {
color: var(--text-color, black);
&:hover,
&:focus {
color: var(--link-hover-color, $tertiary);
}
}
[class*='link--stretched'] {
&:focus {
outline: none;
&::before {
outline: 0.15em solid rgba($grey, 0.75);
outline-offset: $card__internal-spacing;
}
}
}
a:where(:not([class*='link--stretched']):not([class*='button'])) {
position: relative;
z-index: 1;
color: var(--text-color, auto);
}
// Layout Variants
&--has-small-figure {
.card__content {
flex: 10 1 18rem;
}
.card__figure {
flex: 3 99 30%;
}
}
&--has-small-content {
.card__content {
flex: 5 1 10rem;
}
.card__figure {
flex: 3 99 30%;
}
}
&--publication {
> .card__flex {
flex-direction: row;
column-gap: $card__internal-spacing;
}
//.card__content {
// flex: 99 1 18rem;
//}
}
// Theme Variants
&--tertiary {
--accent: #{$tertiary};
--accent-contrast: #{choose-contrast-color-prefer-white($tertiary)};
}
&--bg-gradient-grey {
border-color: transparent;
border-image: none;
background: linear-gradient(to bottom, $grey--lightest, transparent);
padding-top: $spacing-xs;
.card__flag {
display: block;
width: fit-content;
margin-top: -#{$spacing-xs};
margin-left: -#{$border-accent-width};
padding-left: calc($spacing-xs + $spacing-multiplier);
}
}
}