@use 'sass:meta'; @use 'include-media/dist/include-media' as media; @use 'iro-sass/src/iro-sass' as iro; @use '../props'; @forward 'card-list.vars'; @use 'card-list.vars' as vars; @mixin styles { @include props.materialize(meta.module-variables('vars')); @include iro.bem-layout('card-list') { display: flex; flex-direction: column; gap: props.get(vars.$row-gap) props.get(vars.$col-gap); @include iro.bem-modifier('grid') { display: grid; grid-template-columns: repeat(auto-fill, minmax(props.get(vars.$grid--col-width), 1fr)); gap: props.get(vars.$grid--col-gap); @include iro.bem-modifier('quiet') { row-gap: props.get(vars.$grid--row-gap); } } @include iro.bem-modifier('masonry') { display: block; columns: auto props.get(vars.$masonry--col-width); column-gap: props.get(vars.$masonry--col-gap); @include iro.bem-elem('card') { margin-block-end: props.get(vars.$masonry--col-gap); break-inside: avoid; } @include iro.bem-modifier('quiet') { @include iro.bem-elem('card') { margin-block-end: props.get(vars.$masonry--row-gap); } } } @include iro.bem-modifier('masonry-h') { flex-flow: row wrap; gap: props.get(vars.$masonry-h--col-gap); &::after { display: block; flex: 1 0 auto; inline-size: props.get(vars.$masonry-h--row-height); block-size: 0; content: ''; } @include iro.bem-elem('card') { flex: 1 0 auto; max-inline-size: 100%; } @include iro.bem-elem('card-image') { block-size: props.get(vars.$masonry-h--row-height); } @include iro.bem-modifier('quiet') { row-gap: props.get(vars.$masonry-h--row-gap); } } @include iro.bem-modifier('aspect-5\\/4') { @include iro.bem-elem('card-image') { aspect-ratio: 5 / 4; } } } }