From 8c4acea85943a34e62299f419e93a8f3ce142bb9 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 12 Mar 2022 09:53:20 +0100 Subject: Added list group --- src/_config.scss | 10 +++++----- src/_objects.scss | 1 + src/_utils.scss | 4 ++-- src/objects/_list-group.scss | 45 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 src/objects/_list-group.scss (limited to 'src') diff --git a/src/_config.scss b/src/_config.scss index cdbd02c..8520b9e 100644 --- a/src/_config.scss +++ b/src/_config.scss @@ -20,12 +20,12 @@ $wanted-grays: ( --2: -1.1, --3: 1, - --4: 1.15, - --5: 1.3, - --6: 1.7, + --4: 1.1, + --5: 1.25, + --6: 1.5, - --7: 2.4, - --8: 3.3, + --7: 2.2, + --8: 3.1, --9: 6, --10: 11, --11: 19, diff --git a/src/_objects.scss b/src/_objects.scss index 4049101..ce91f5b 100644 --- a/src/_objects.scss +++ b/src/_objects.scss @@ -16,3 +16,4 @@ @use 'objects/backdrop'; @use 'objects/dialog'; @use 'objects/lightbox'; +@use 'objects/list-group'; diff --git a/src/_utils.scss b/src/_utils.scss index ce0220a..1969a82 100644 --- a/src/_utils.scss +++ b/src/_utils.scss @@ -63,7 +63,7 @@ $dirs: ( margin#{$suffix}: auto; } - @each $size in (0 10 50 100 200) { + @each $size in (0 10 50 100 200 400) { @include iro.bem-utility('m#{$dir}-#{$size}') { margin#{$suffix}: fn.global-dim(--size --#{$size}); } @@ -75,7 +75,7 @@ $dirs: ( padding#{$suffix}: auto; } - @each $size in (0 10 50 100 200) { + @each $size in (0 10 50 100 200 400) { @include iro.bem-utility('p#{$dir}-#{$size}') { padding#{$suffix}: fn.global-dim(--size --#{$size}); } diff --git a/src/objects/_list-group.scss b/src/objects/_list-group.scss new file mode 100644 index 0000000..521bc19 --- /dev/null +++ b/src/objects/_list-group.scss @@ -0,0 +1,45 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('list-group') { + @include iro.props-store(( + --dims: ( + --pad-x: fn.global-dim(--size --175), + --pad-y: fn.global-dim(--size --125), + --rounding: 3px, + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--bg-hi2), + --border: fn.global-color(--obj), + --hover: fn.global-color(--bg), + --press: fn.global-color(--obj-hi), + ) + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + border: 1px solid fn.color(--border); + border-radius: fn.dim(--rounding); + background-color: fn.color(--bg); + + @include iro.bem-elem('item') { + padding: fn.dim(--pad-y) fn.dim(--pad-x); + + @include iro.bem-next-twin-elem { + border-top: 1px solid fn.color(--border); + } + + @include iro.bem-multi('&:link, &:visited, &:enabled', 'modifier' 'action') { + &:hover { + background-color: fn.color(--hover); + } + + &:active { + background-color: fn.color(--press); + } + } + } + } +} -- cgit v1.2.3-70-g09d2