From f98a5c58c830a283d07d8efad4502281a5e0369e Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 28 Jun 2024 14:22:27 +0200 Subject: Update --- src/layouts/_card-list.scss | 78 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/layouts/_card-list.scss (limited to 'src/layouts') diff --git a/src/layouts/_card-list.scss b/src/layouts/_card-list.scss new file mode 100644 index 0000000..c27b297 --- /dev/null +++ b/src/layouts/_card-list.scss @@ -0,0 +1,78 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; +@use 'include-media/dist/include-media' as media; + +@include iro.props-namespace('card-list') { + @include iro.props-store(( + --dims: ( + --row-gap: fn.global-dim(--size --800), + --col-gap: fn.global-dim(--size --400), + + --grid: ( + --row-gap: fn.global-dim(--size --800), + --col-gap: fn.global-dim(--size --400), + --col-width: fn.global-dim(--size --3200), + ), + --masonry: ( + --row-gap: fn.global-dim(--size --800), + --col-gap: fn.global-dim(--size --400), + --col-width: fn.global-dim(--size --3200), + ), + --masonry-h: ( + --row-gap: fn.global-dim(--size --800), + --col-gap: fn.global-dim(--size --400), + --row-height: fn.global-dim(--size --3200), + ) + ), + --colors: ( + --border: fn.global-color(--border), + ), + )); + + @include iro.bem-layout(iro.props-namespace()) { + display: flex; + flex-direction: column; + gap: fn.dim(--row-gap) fn.dim(--col-gap); + + @include iro.bem-modifier('grid') { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(fn.dim(--grid --col-width), 1fr)); + gap: fn.dim(--grid --row-gap) fn.dim(--grid --col-gap); + } + + @include iro.bem-modifier('masonry') { + display: block; + columns: auto fn.dim(--masonry --col-width); + column-gap: fn.dim(--masonry --col-gap); + + @include iro.bem-elem('card') { + margin-bottom: fn.dim(--masonry --row-gap); + } + } + + @include iro.bem-modifier('masonry-h') { + flex-flow: row wrap; + gap: fn.dim(--masonry-h --row-gap) fn.dim(--masonry-h --col-gap); + + @include iro.bem-elem('card') { + flex: 1 0 auto; + max-width: 100%; + } + + @include iro.bem-elem('card-content') { + height: fn.dim(--masonry-h --row-height); + } + + @include iro.bem-elem('dummy') { + flex: 1 0 auto; + width: fn.dim(--masonry-h --row-height); + } + } + + @include iro.bem-modifier('aspect-5\\/4') { + @include iro.bem-elem('card') { + aspect-ratio: 5 / 4; + } + } + } +} -- cgit v1.2.3-70-g09d2