From 86251b230e1c3b91c941ff1bbed25d9a5c8021a9 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 19 Jun 2021 20:08:15 +0200 Subject: Color adjustments, improved cards --- assets/css/components/_card.scss | 63 ++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 29 deletions(-) (limited to 'assets/css/components/_card.scss') diff --git a/assets/css/components/_card.scss b/assets/css/components/_card.scss index 9a49cfd..c153406 100644 --- a/assets/css/components/_card.scss +++ b/assets/css/components/_card.scss @@ -3,39 +3,27 @@ --dims: ( --pad-x: 1.1em, --pad-y: .8em, - --hover-offset: -.5rem, + --hover-offset: -.3rem, + --indicator: ( + --width: 4px, + --height: 1em, + ), ), --colors: ( - --bg: prop(--colors --bg-lo, $global: true), - --fg: prop(--colors --fg, $global: true), + --bg: prop(--colors --bg-lo, $global: true), + --fg: prop(--colors --fg, $global: true), + --unread: prop(--colors --bg, $global: true), --hover: ( --bg: prop(--colors --fg-lo, $global: true), --fg: prop(--colors --bg-hi, $global: true), ), - --link: ( - --bg: prop(--colors --obj-hi, $global: true), - --fg: prop(--colors --fg-lo, $global: true), - --fg-hi: prop(--colors --fg, $global: true), - ), ) )); @include store(( --colors: ( - --bg: prop(--colors --bg-hi, $global: true), - --link: ( - --bg: hsl( - #{prop(--colors --link --colored --idle-h, $global: true)}, - #{prop(--colors --link --colored --idle-s, $global: true)}, - 98.8% - ), - --fg: prop(--colors --link --colored --idle, $global: true), - --fg-hi: hsl( - #{prop(--colors --link --colored --idle-h, $global: true)}, - calc(#{prop(--colors --link --colored --idle-s, $global: true)} * .7), - calc(#{prop(--colors --link --colored --idle-l, $global: true)} * 1.3) - ), - ), + --bg: prop(--colors --bg-hi, $global: true), + --unread: prop(--colors --bg-lo, $global: true), ) ), 'light'); @@ -84,16 +72,19 @@ * { color: currentColor; } + + @include element('block') { + @include modifier('indicator') { + color: prop(--colors --hover --bg); + } + } } } - @include modifier('mark-visited') { - &:link { - background-color: prop(--colors --link --bg); - color: prop(--colors --link --fg); - - small { - color: prop(--colors --link --fg-hi); + &:visited { + @include element('block') { + @include modifier('indicator') { + color: prop(--colors --unread); } } } @@ -106,6 +97,20 @@ flex-shrink: 1; width: 100%; } + + @include modifier('indicator') { + transition: color .2s; + color: prop(--colors --bg); + + &::before { + content: ''; + display: block; + width: prop(--dims --indicator --width); + height: prop(--dims --indicator --height); + border-radius: prop(--dims --indicator --height); + background-color: currentColor; + } + } } } } -- cgit v1.2.3-54-g00ecf