@include namespace('card') { @include store(( --colors: ( --bg: prop(--colors --bg-lo, $global: true), --fg: prop(--colors --fg, $global: true), --unread: prop(--colors --bg, $global: true), --border: prop(--colors --obj-hi, $global: true), --hover: ( --bg: prop(--colors --fg-lo, $global: true), --fg: prop(--colors --bg-hi, $global: true), ), ), --dims: ( --pad-x: 1em, --pad-y: px-to-em(12px), --hover-offset: px-to-em(-5px), --indicator: ( --width: 1em, --height: 4px, ), ) )); @include store(( --colors: ( --bg: prop(--colors --bg-hi, $global: true), --unread: prop(--colors --bg-lo, $global: true), --border: prop(--colors --bg-lo, $global: true), ) ), 'light'); @include component(namespace()) { display: block; position: relative; transform: translateY(0); transition: transform .2s, background-color .2s, color .2s, border-color .2s; background-color: prop(--colors --bg); color: prop(--colors --fg); line-height: 1.4; &::after { content: ''; display: none; position: absolute; top: 100%; left: 0; width: 100%; height: calc(-1 * #{prop(--dims --hover-offset)}); } small, strong { transition: color .2s; } &:link, &:visited { text-decoration: none; &:hover, &:focus { transform: translateY(#{prop(--dims --hover-offset)}); background-color: prop(--colors --hover --bg); color: prop(--colors --hover --fg); &::after { display: block; } small, strong { color: prop(--colors --hover --fg); } @include element('row') { @include modifier('hidden') { visibility: visible; transition: opacity .2s; opacity: 1; } } @include element('block') { @include modifier('indicator') { color: prop(--colors --hover --fg); } } } } &:visited { @include element('block') { @include modifier('indicator') { color: prop(--colors --bg); } } } @include modifier('outline') { border: 1px solid prop(--colors --border); background-color: transparent; &:link, &:visited { &:hover, &:focus { border-color: transparent; } } } @include element('row') { display: flex; align-items: center; padding: prop(--dims --pad-y) prop(--dims --pad-x); gap: prop(--dims --pad-x); @include modifier('flush') { padding: 0; } @include modifier('hidden') { visibility: hidden; position: absolute; z-index: 10; right: 0; bottom: 0; left: 0; transition: opacity .2s, visibility 0s .2s; opacity: 0; background-color: prop(--colors --hover --bg); @media (hover: none) { visibility: visible; position: static; opacity: 1; background-color: transparent; } } } @include element('thumbnail') { position: relative; width: 100%; height: 2em; padding-top: 46%; } @include element('thumbnail-img') { display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; } @include element('block') { flex: 0 0 auto; overflow: hidden; text-overflow: ellipsis; @include modifier('main') { flex-shrink: 1; width: 100%; } @include modifier('indicator') { transition: color .2s; color: prop(--colors --unread); &::before { content: ''; display: block; width: prop(--dims --indicator --width); height: prop(--dims --indicator --height); border-radius: prop(--dims --indicator --height); background-color: currentColor; } } } @media print { border: 2px solid currentColor; } } }