From d23a2cf25ccc33f49d73ee3da2f775c0d4fa0784 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 27 Jun 2024 09:56:02 +0200 Subject: Update --- src/objects/_card.scss | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/objects/_card.scss (limited to 'src/objects/_card.scss') diff --git a/src/objects/_card.scss b/src/objects/_card.scss new file mode 100644 index 0000000..07256cb --- /dev/null +++ b/src/objects/_card.scss @@ -0,0 +1,88 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('card') { + @include iro.props-store(( + --dims: ( + --border: fn.global-dim(--border --thin), + --divider: fn.global-dim(--border --thin), + --pad-i: fn.global-dim(--size --300), + --pad-b: fn.global-dim(--size --250), + --spacing: fn.global-dim(--size --200), + --rounding: fn.global-dim(--rounding), + + --key-focus: ( + --border: fn.global-dim(--key-focus --border), + --border-offset: fn.global-dim(--key-focus --border-offset), + --outline: fn.global-dim(--key-focus --outline), + ), + ), + --colors: ( + --bg: fn.global-color(--bg-l2), + --border: fn.global-color(--border-mute), + --divider: fn.global-color(--border-mute), + + --hover: ( + --border: fn.global-color(--border), + ), + --key-focus: ( + --label: fn.global-color(--focus --text), + --border: fn.global-color(--focus --border), + --outline: fn.global-color(--focus --outline), + ), + ), + )); + + @include iro.bem-object(iro.props-namespace()) { + display: block; + border: fn.dim(--border) solid fn.color(--border); + border-radius: fn.dim(--rounding); + background-color: fn.color(--bg); + + @include iro.bem-multi('&:link, &:visited, &:enabled', 'modifier' 'interactive') { + &:hover, + &:focus-visible, + &:active { + border-color: fn.color(--hover --border); + } + + &:focus-visible { + border-color: fn.color(--key-focus --border); + outline: fn.color(--key-focus --border) solid calc(fn.dim(--key-focus --border) - fn.dim(--border)); + box-shadow: 0 0 0 calc(fn.dim(--key-focus --border) + fn.dim(--key-focus --outline)) fn.color(--key-focus --outline); + } + } + + @include iro.bem-elem('thumbnail') { + position: relative; + width: 100%; + height: 100%; + } + + @include iro.bem-elem('thumbnail-img') { + display: block; + object-fit: cover; + width: 100%; + height: 100%; + } + + @include iro.bem-elem('body') { + padding-block: fn.dim(--pad-b); + padding-inline: fn.dim(--pad-i); + } + + @include iro.bem-elem('footer') { + padding-block: 0 fn.dim(--pad-b); + padding-inline: fn.dim(--pad-i); + margin-block-start: calc(-1 * fn.dim(--pad-b)); + + &::before { + content: ''; + display: block; + height: fn.dim(--divider); + margin-block: fn.dim(--spacing); + background-color: fn.color(--divider); + } + } + } +} -- cgit v1.2.3-70-g09d2