From 48cb00040763459fc46d4aa108bf72c12f48f422 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 21 Jun 2024 23:07:50 +0200 Subject: WIP: Refactoring --- src/.old/objects/_table.scss | 167 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 src/.old/objects/_table.scss (limited to 'src/.old/objects/_table.scss') diff --git a/src/.old/objects/_table.scss b/src/.old/objects/_table.scss new file mode 100644 index 0000000..34512cb --- /dev/null +++ b/src/.old/objects/_table.scss @@ -0,0 +1,167 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; +@use '../mixins' as mx; + +@include iro.props-namespace('table') { + @include iro.props-store(( + --dims: ( + --pad-x: fn.global-dim(--size --175), + --pad-y: fn.global-dim(--size --125), + --rounding: 3px, + --50: ( + --pad-y: fn.global-dim(--size --75), + ) + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --border: fn.global-color(--obj), + --heading: fn.global-color(--fg-hi), + --hover: fn.global-color(--obj-hi), + --press: fn.global-color(--obj), + --box: ( + --bg: fn.global-color(--bg-hi2), + --hover: fn.global-color(--bg), + --press: fn.global-color(--obj-hi), + ) + ) + ), 'colors'); + + @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: 500, + --transform: uppercase, + --spacing: .5px + )); + + padding: fn.dim(--pad-y) fn.dim(--pad-x); + color: fn.color(--heading); + text-align: left; + } + + @include iro.bem-elem('cell') { + padding: fn.dim(--pad-y) fn.dim(--pad-x); + border-width: 1px 0 0; + border-style: solid; + border-color: fn.color(--border); + + @include iro.bem-modifier('divider') { + border-right-width: 1px; + } + } + + @include iro.bem-elem('row') { + &:last-child { + @include iro.bem-elem('cell') { + border-bottom-width: 1px; + } + } + } + + @include iro.bem-modifier('flush') { + @include iro.bem-elem('head-cell', 'cell') { + &:first-child { + padding-left: 0; + } + + &:last-child { + padding-right: 0; + } + } + } + + @include iro.bem-modifier('box') { + @include iro.bem-elem('cell') { + background-color: fn.color(--box --bg); + + &:first-child { + border-left-width: 1px; + } + + &:last-child { + border-right-width: 1px; + } + } + + @include iro.bem-elem('row') { + &:first-child { + @include iro.bem-elem('cell') { + &:first-child { + border-top-left-radius: fn.dim(--rounding); + } + + &:last-child { + border-top-right-radius: fn.dim(--rounding); + } + } + } + + &:last-child { + @include iro.bem-elem('cell') { + &:first-child { + border-bottom-left-radius: fn.dim(--rounding); + } + + &:last-child { + border-bottom-right-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(--press); + } + } + } + + @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 --press); + } + } + } + } + } + + @include iro.bem-modifier('50') { + @include iro.bem-elem('head-cell', 'cell') { + padding-top: fn.dim(--50 --pad-y); + padding-bottom: fn.dim(--50 --pad-y); + } + } + } +} -- cgit v1.2.3-54-g00ecf