/* Variables */ $card-bg: $white !default; $card-secondary-bg: $light-gray-dark; $card-border: $border; $card-border-radius: $global-radius; $card-border-top-width: 8px !default; $card-shadow: 0 2px 7px rgba(black, .1); $card-id: $medium-gray; $card-padding-small: 1rem; $card-padding: 1.5rem; $card-margin-bottom: map-get($grid-column-gutter, medium); $card-footer-bg: $light-gray-dark; $card-proposal: var(--proposals); $card-action: var(--actions); $card-debate: var(--debates); $card-meeting: var(--meetings); $card-spaces: var(--meetings); $datetime-bg: var(--primary); /* Cards */ .card{ margin-bottom: $card-margin-bottom; background: $card-bg; border: $card-border; border-radius: $card-border-radius; // Keep visible for accessibility (active/focused card as a link) overflow: visible; @include modifiers( border-top-color, ( muted: rgba($muted, .3), ) ){ border-top-width: $card-border-top-width; } } .card--nomargin{ margin-bottom: 0; } .card--secondary{ background: $card-secondary-bg; box-shadow: none; } .card__content{ padding: $card-padding-small; &:not(:only-child){ padding-bottom: $card-padding-small * .5; } @include breakpoint(medium){ padding: $card-padding; &:not(:only-child){ padding-bottom: $card-padding * .5; } } } .card__content--center{ text-align: center; } .card__extra{ background: $card-secondary-bg; padding: $card-padding-small; } .card__title{ @extend .heading5; } a.card__title, a .card__title{ &:hover{ text-decoration: underline; } } .card__header{ margin-bottom: $card-padding * .5; .card__title{ margin-bottom: .5rem; } &.collapse{ margin-bottom: 0; } } .card__button{ margin-bottom: 0; cursor: pointer; } .card__type{ background: $light-gray-dark; padding: .1rem 1rem; margin-top: .5rem; margin-bottom: -.75rem; font-size: 80%; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: $muted; display: flex; align-self: flex-start; align-items: center; .icon{ width: 14px; height: 14px; fill: $muted; margin-right: .2rem; } } .card__text{ &:first-child{ margin-top: -.25em; //balances top alignment in card } a:hover{ color: darken($secondary, 20%); text-decoration: underline; } .card__text--status{ font-weight: bold; text-transform: uppercase; &::after{ content: " "; } @include modifiers( color, ( muted: $muted, ) ); } .card__text--category{ display: block; margin-top: $global-margin * .5; } &:not(:last-child){ margin-bottom: $global-margin * .5; } &.card--picture-offset{ // _author-avatar.scss:58 (.author-data--big .author__avatar img) // _author-avatar.scss:133 padding (.author__avatar) margin-left: calc(#{rem-calc(54)} + .5rem); } } .card__text--separated-mid-dot{ @include inline-separator(" ยท "); } .card__image{ width: 100%; max-height: 10rem; min-height: 5rem; object-fit: cover; &.card__image--smaller{ max-height: 5rem; } &.card__image--larger{ max-height: 20rem; min-height: 10rem; } } /* Card datetime */ // NOTE: Possible deprecated .card__datetime{ flex-shrink: 0; text-align: center; margin-bottom: 1rem; padding: .5rem; font-weight: 600; display: flex; align-items: baseline; border-left: 4px solid var(--primary); background: $card-secondary-bg; line-height: 1; } .card__datetime__date{ font-size: 1.4rem; margin-right: 1rem; } .card__datetime__month{ text-transform: lowercase; font-variant: small-caps; font-size: 1.2rem; } .card__datetime__time{ font-size: .8rem; } /* Card footer */ .card__footer{ background: $card-footer-bg; border-top: $card-border; border-radius: 0 0 $card-border-radius $card-border-radius; clear: both; .card__content{ display: flex; } } .card__footer--transparent{ background: transparent; } .card__footer--data{ display: flex; align-items: center; .card__content{ flex-grow: 1; } .card-data{ flex-direction: column; } .card-data__item{ flex-basis: auto; border-right: none; border-left: $border; border-bottom: $border; &:last-of-type{ border-bottom: none; } } } .card__author{ margin-bottom: .5rem; // Hack when there's a toggler list [data-toggler]{ margin-bottom: -.5rem; } &.inline-block{ display: inline-block; } } .card__voting{ display: inline-block; text-align: center; } .card__vote-number{ font-size: 1.3rem; font-weight: 600; line-height: 1; } /* Card activity date */ .card__activity-date{ margin-bottom: .5rem; &.inline-block{ display: inline-block; &.before-content::before{ content: ""; margin-right: .8rem; border-right: $border; height: .7rem; display: inline-block; vertical-align: middle; } } } /* Card data */ .card-data{ list-style: none; margin: 0; display: flex; flex-wrap: wrap; a:hover{ text-decoration: underline; } span:focus{ outline: $anchor-outline-focus; outline-color: var(--highlight); outline-offset: $anchor-outline-offset; } } .card-data__item{ display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex-basis: 33.33%; flex-grow: 1; text-align: center; font-size: rem-calc(15); line-height: 1; color: $muted; padding: .5em; border-right: $border; margin-right: -1px; border-top: $border; margin-top: -1px; .card-data__item--centerblock{ margin: 0 auto; } &.card-data__item--expand{ line-height: $global-lineheight; } &.creation_date_status strong{ text-transform: uppercase; font-weight: 600; font-size: .8em; letter-spacing: .05em; color: $body-font-color; } [data-toggle]{ margin-bottom: 0; } } .card-data__item__number{ display: block; line-height: 1; font-weight: 600; font-size: rem-calc(20); color: $body-font-color; margin-bottom: .2rem; } .card-data__item--multiple{ display: flex; justify-content: space-between; align-items: center; @include flexgap(1rem); > div{ text-align: left; display: block; } } /* Card popularity */ .card__popularity{ padding: $card-padding; text-align: center; .icon{ fill: $medium-gray; } } .card__popularity__data{ text-align: center; font-size: 85%; line-height: 1; margin-bottom: .2rem; color: $muted; } /* Card support */ .card__support{ margin-left: auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: $card-padding-small; @include breakpoint(medium){ padding: $card-padding; } > *:only-child{ margin-left: auto; } .card__button{ font-size: $small-font-size; } } .card__support__data{ text-align: center; font-size: 85%; line-height: 1; margin-bottom: .2rem; color: $muted; } .card__support__data--left{ @extend .card__support__data; text-align: left; text-transform: none; margin-bottom: 0; color: $muted; max-width: 60%; strong{ font-size: rem-calc(16); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } } .card__support__number{ line-height: 1; font-weight: 600; font-size: rem-calc(20); color: $body-font-color; } /* Card with image */ .card__img{ text-align: center; @include breakpoint(large){ float: right; width: 35%; } } .card__content--img{ @include breakpoint(large){ float: left; width: 60%; } } /* Card Link */ .card__link{ color: $anchor-color; &:hover{ color: $anchor-color; text-decoration: underline; } &:focus{ z-index: 2; // Raise the focus border on top of overflowing elements outline: $anchor-outline-focus; outline-offset: $anchor-outline-offset; } } .card__link--block{ display: block; } /* Card list */ .card--list{ .card--list__item:not(:last-child), *:not(:last-child) .card--list__item{ border-bottom: $border; } } .card--list__item{ display: flex; align-items: center; padding-left: $card-padding-small; .card--list--mini &{ padding-left: $card-padding-small; .card__link{ display: flex; align-items: center; } } @include breakpoint(medium){ padding-left: $card-padding; } svg{ flex-basis: 15%; flex-shrink: 0; } svg + div{ max-width: calc(85% - #{$global-margin}); overflow-wrap: break-word; } } .card--list__icon{ display: none; fill: $anchor-color; @include modifiers(fill); @include breakpoint(medium){ margin-right: 1rem; display: block; width: 30px; height: 30px; flex-shrink: 0; } } .card--list__text{ flex-grow: 1; flex-shrink: 1; display: inline-flex; align-items: center; padding: 1rem 1rem 1rem 0; // Keep visible for accessibility (active/focused card as a link) overflow: visible; &.card--list__text--top{ align-items: start; } .card--list--mini &{ padding: .5rem .5rem .5rem 0; > *{ flex-grow: 1; } } .author{ margin-top: .3rem; margin-right: 1rem; } } .card--list__heading{ margin-bottom: 0; display: block; &.heading6{ text-transform: unset; letter-spacing: unset; font-weight: unset; } } .card--list .tags{ @include breakpoint(medium down){ display: none; } } .card--list__data{ flex-shrink: 0; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 85%; min-width: 7rem; line-height: 1; color: $muted; padding: $card-padding-small; background: $card-secondary-bg; @include breakpoint(medium){ padding: 1rem $card-padding; } .card--list--mini &{ padding: .5rem $card-padding-small; } } .card--list__data-added{ background-color: tint($success, 80%); a{ color: $body-font-color; } } .card--list__check{ margin-bottom: 0; border-radius: 50%; align-self: center; flex-shrink: 0; width: 2em; height: 2em; padding: 0; display: flex; justify-content: center; align-items: center; margin-left: auto; &--disabled{ pointer-events: none; } &--inline{ display: inline-block; } svg{ flex-basis: auto; } } .card--list__data__icon{ .icon{ width: 20px; height: 20px; fill: $muted; } &:hover{ .icon{ fill: $anchor-color; } } } .card--list__data__icon--lg{ @extend .card--list__data__icon; .icon{ width: 36px; height: 36px; } } .card--list__data__number{ @extend .card-data__item__number; font-size: 1.5rem; } .card--list__titled-text{ @extend .card--list__text; flex-wrap: wrap; $date-width: 28px; .card--list__heading{ margin-bottom: 5px; width: calc(100% - #{$date-width}); } .card--list__annotation{ letter-spacing: .03em; font-size: .7em; font-weight: 600; text-transform: uppercase; width: $date-width; } .card--list__counter{ $counter-size: 20px; $counter-font-size: $counter-size - 8px; background-color: $secondary; border-radius: 50%; color: $white; font-size: $counter-font-size; font-weight: 600; margin-left: auto; width: $counter-size; span{ display: block; line-height: $counter-size; text-align: center; } } } .card--list__author{ @extend .card--list__titled-text; padding: .5rem 1rem .5rem 0; margin-left: -.5rem; .author{ margin: 0; } .author__avatar img{ border-radius: 2px; } } /* Card full width variant */ .card--full{ margin-bottom: $card-margin-bottom * 2; &:last-child{ margin-bottom: 0; } .card__title{ @extend .heading2; &:hover{ text-decoration: underline; } &:focus{ outline: $anchor-outline-focus; outline-color: var(--highlight); outline-offset: $anchor-outline-offset; } } .card__content{ padding: $card-padding; @include breakpoint(large){ padding: $card-padding * 2; } } } .card--full__image{ background-size: cover; background-position: center; background-repeat: no-repeat; position: relative; @include breakpoint(medium only){ min-height: 15rem; display: flex; align-items: center; justify-content: center; } > .card__content{ position: relative; z-index: 1; @include breakpoint(medium only){ min-width: 50%; } @include breakpoint(mediumlarge){ position: absolute; top: 0; width: 100%; } } } //small card with top image .card__image-top{ background-size: cover; background-position: center; background-repeat: no-repeat; height: 10rem; .card--process &{ display: none; @include breakpoint(mediumlarge){ display: block; } } } /* Card full width process variant */ @include breakpoint(mediumlarge){ .card--process__row{ display: flex; } .card--process__column{ position: relative; .card--full__image-wrapper{ height: 100%; overflow: hidden; } .card--full__image{ height: 100%; position: absolute; right: -1px; left: 0; > img{ min-height: 100%; max-width: initial; position: absolute; } } } } .card--process__small{ font-size: $small-font-size; &:last-child{ margin-bottom: 0; } } // card mini .card--mini{ .card__content{ padding: $card-padding $card-padding-small; display: flex; flex-direction: column; flex-grow: 1; } .card__image-top{ display: block; height: 8rem; } .card--process__small{ margin-top: auto; } } // card status .card__status{ .card-data__item{ flex-basis: 20%; flex-basis: initial; padding: 1em .5em; &:empty{ border-right: 0; & + .card-data__item:not(:empty){ border-left: $border; } } } } // card label .card__label{ display: inline-flex; color: $card-id; padding: 0 .5rem; font-size: $small-font-size; font-weight: bold; position: absolute; background-color: transparent; text-shadow: -1px -1px 0 $card-bg, 1px -1px 0 $card-bg, -1px 1px 0 $card-bg, 1px 1px 0 $card-bg; margin-top: ($global-margin * .6) * -1; margin-left: $card-padding-small; z-index: 0; &::before{ content: " "; height: $border-width; display: inline-block; background-color: $body-background; position: absolute; left: 0; right: 0; z-index: -1; top: $global-margin * .5; } .card.success &, .card.secondary &, .card.muted &, .card.warning &, .card.alert &{ margin-top: ($global-margin * .95) * -1; &::before{ height: $card-border-top-width; top: $global-margin * .45; } } .icon{ // Reduces some icon space margin-left: -.25rem; } @include breakpoint(medium){ margin-left: $card-padding; } @include modifiers( color, ( muted: tint($muted, 50), ) ){ margin-top: -$global-margin * .95; } } // card metadata with icon .card__icondata{ ul{ align-items: stretch; border-top: $border; li{ border-top: 0; display: flex; align-items: center; justify-content: center; > *{ margin: .5rem; } } li:first-child{ color: var(--primary); flex: 0; } li:not(:first-child){ font-size: $global-font-size; text-transform: none; justify-content: left; flex-direction: row; strong{ text-transform: uppercase; font-weight: 600; font-size: .8em; letter-spacing: .05em; color: $body-font-color; } .card__icondata--address{ color: $body-font-color; line-height: 120%; & + a{ display: block; margin-top: $global-margin; } } } } } .card__block{ @extend .card__icondata; margin-bottom: $global-margin * .5; ul{ border: $border; li{ padding: .25em; } } } // card stack .card--stack{ position: relative; overflow: visible; z-index: 0; &, &::after, &::before{ /* Add shadow to distinguish sheets from one another */ box-shadow: 1px 1px 1px rgba(0, 0, 0, .15); } &::after, &::before{ content: ""; position: absolute; width: 100%; height: 100%; border-radius: $card-border-radius; } /* Second sheet of paper */ &::before{ left: 3px; top: 3px; z-index: -1; } /* Third sheet of paper */ &::after{ left: 5px; top: 5px; z-index: -2; } } .card--widget{ .card-data{ flex-wrap: inherit; .card-data__item{ color: $body-font-color; text-transform: none; font-size: rem-calc(16); text-align: left; padding: $card-padding-small; @include modifiers(color); @include breakpoint(medium){ padding: $card-padding; } &:first-child{ flex-grow: 0; flex-basis: 12%; background-color: $card-secondary-bg; position: relative; > div{ display: flex; flex-direction: column; align-items: center; @include absolute-center; } } } } } // card - participatory space .card__top{ @extend .card__footer; border-top: 0; .card__content{ line-height: $global-lineheight; padding: $card-padding-small * .25 $card-padding-small; > :first-child{ flex-shrink: 0; } @include breakpoint(medium){ padding: $card-padding * .25 $card-padding; } } } // card row .card__row{ @include flex; @include flex-align($x: left, $y: null); flex-direction: column; @include breakpoint(medium){ flex-direction: row; } > *{ padding: $global-margin; flex: 0 0 25%; &:not(:nth-child(4n)){ border-right: 0; border-bottom: $card-border; @include breakpoint(medium){ border-bottom: 0; border-right: $card-border; } } } }