@use 'iro-sass/src/iro-sass' as iro; @use '../functions' as fn; @use '../mixins' as mx; @include iro.props-namespace('table') { @include iro.props-store(( --dims: ( --pad-i: fn.global-dim(--size --175), --pad-b: fn.global-dim(--size --125), --rounding: fn.global-dim(--rounding), --border: fn.global-dim(--border --thin), --sm: ( --pad-b: fn.global-dim(--size --75), ) ), --colors: ( --border: fn.global-color(--border), --heading: fn.global-color(--heading), --hover: fn.global-color(--border-mute), --active: fn.global-color(--border), --box: ( --bg: fn.global-color(--base --50), --hover: fn.global-color(--bg-base), --active: fn.global-color(--border-mute), ) ) )); @include iro.bem-object(iro.props-namespace()) { border-spacing: 0; border-collapse: separate; @include iro.bem-modifier('fixed') { table-layout: fixed; } @include iro.bem-elem('head-cell') { @include mx.set-font(--standard, ( --line-height: null, --size: fn.global-dim(--font-size --50), --weight: bold, --transform: uppercase, --spacing: .5px )); padding-block: fn.dim(--pad-b); padding-inline: fn.dim(--pad-i); color: fn.color(--heading); text-align: start; } @include iro.bem-elem('cell') { padding-block: fn.dim(--pad-b); padding-inline: fn.dim(--pad-i); border-color: fn.color(--border); border-style: solid; border-width: 0; border-block-start-width: fn.dim(--border); @include iro.bem-modifier('divider') { border-inline-end-width: fn.dim(--border); } } @include iro.bem-elem('row') { &:last-child { @include iro.bem-elem('cell') { border-block-end-width: fn.dim(--border); } } } @include iro.bem-modifier('flush') { @include iro.bem-elem('head-cell', 'cell') { &:first-child { padding-inline-start: 0; } &:last-child { padding-inline-end: 0; } } } @include iro.bem-modifier('box') { @include iro.bem-elem('cell') { background-color: fn.color(--box --bg); &:first-child { border-inline-start-width: fn.dim(--border); } &:last-child { border-inline-end-width: fn.dim(--border); } } @include iro.bem-elem('row') { &:first-child { @include iro.bem-elem('cell') { &:first-child { border-start-start-radius: fn.dim(--rounding); } &:last-child { border-start-end-radius: fn.dim(--rounding); } } } &:last-child { @include iro.bem-elem('cell') { &:first-child { border-end-start-radius: fn.dim(--rounding); } &:last-child { border-end-end-radius: fn.dim(--rounding); } } } } } @include iro.bem-modifier('interactive') { @include iro.bem-elem('row') { @include iro.bem-elem('cell') { cursor: pointer; } &:hover { @include iro.bem-elem('cell') { background-color: fn.color(--hover); } } &:active { @include iro.bem-elem('cell') { background-color: fn.color(--active); } } } @include iro.bem-modifier('box') { @include iro.bem-elem('row') { &:hover { @include iro.bem-elem('cell') { background-color: fn.color(--box --hover); } } &:active { @include iro.bem-elem('cell') { background-color: fn.color(--box --active); } } } } } @include iro.bem-modifier('sm') { @include iro.bem-elem('head-cell', 'cell') { padding-block: fn.dim(--sm --pad-b); } } } }