From 72267cf11140ba5a339bd8cd238e2942b545203c Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 15 Feb 2023 21:55:30 +0100 Subject: Updated link scope --- src/scopes/_colored-links.scss | 38 ----------------------------- src/scopes/_invisible-links.scss | 32 ------------------------- src/scopes/_links.scss | 52 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 70 deletions(-) delete mode 100644 src/scopes/_colored-links.scss delete mode 100644 src/scopes/_invisible-links.scss create mode 100644 src/scopes/_links.scss (limited to 'src/scopes') diff --git a/src/scopes/_colored-links.scss b/src/scopes/_colored-links.scss deleted file mode 100644 index 15614ba..0000000 --- a/src/scopes/_colored-links.scss +++ /dev/null @@ -1,38 +0,0 @@ -@use 'iro-sass/src/index' as iro; -@use '../functions' as fn; - -@include iro.props-namespace('colored-links') { - @include iro.props-store(( - --colors: ( - --idle: fn.global-color(--accent --link-idle --quiet --fg), - --visited: fn.global-color(--accent --link-visited --quiet --fg), - --key-focus: ( - --border: fn.global-color(--focus --fill), - --shadow: 0 0 0 calc(fn.global-dim(--focus --outline-width) + 2px) fn.global-color(--accent --primary --quiet --obj-lo), - ), - ) - ), 'colors'); - - @include iro.bem-scope(iro.props-namespace()) { - :link { - color: fn.color(--idle); - text-decoration: underline; - } - - :visited { - color: fn.color(--visited); - text-decoration: underline; - } - - :link, - :visited { - border-radius: .5px; - - @include iro.bem-at-theme('keyboard') { - &:focus { - box-shadow: 0 0 0 2px fn.color(--key-focus --border), fn.color(--key-focus --shadow); - } - } - } - } -} diff --git a/src/scopes/_invisible-links.scss b/src/scopes/_invisible-links.scss deleted file mode 100644 index 32e8e7c..0000000 --- a/src/scopes/_invisible-links.scss +++ /dev/null @@ -1,32 +0,0 @@ -@use 'iro-sass/src/index' as iro; -@use '../functions' as fn; - -@include iro.props-namespace('invisible-links') { - @include iro.props-store(( - --colors: ( - --key-focus: ( - --border: fn.global-color(--focus --fill), - --shadow: 0 0 0 calc(fn.global-dim(--focus --outline-width) + 2px) fn.global-color(--accent --primary --quiet --bg), - ), - ) - ), 'colors'); - - @include iro.bem-scope(iro.props-namespace()) { - :link, - :visited { - border-radius: .5px; - color: currentColor; - text-decoration: none; - - &:hover { - text-decoration: underline; - } - - @include iro.bem-at-theme('keyboard') { - &:focus { - box-shadow: 0 0 0 2px fn.color(--key-focus --border), fn.color(--key-focus --shadow); - } - } - } - } -} diff --git a/src/scopes/_links.scss b/src/scopes/_links.scss new file mode 100644 index 0000000..4d9e571 --- /dev/null +++ b/src/scopes/_links.scss @@ -0,0 +1,52 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('links') { + @include iro.props-store(( + --colors: ( + --idle: fn.global-color(--accent --link-idle --quiet --fg), + --visited: fn.global-color(--accent --link-visited --quiet --fg), + + --key-focus: ( + --border: fn.global-color(--focus --fill), + --shadow: 0 0 0 calc(fn.global-dim(--focus --outline-width) + 2px) fn.global-color(--accent --primary --quiet --obj-lo), + ), + ) + ), 'colors'); + + @include iro.bem-scope(iro.props-namespace()) { + :link, + :visited { + border-radius: .5px; + color: currentColor; + text-decoration: underline; + + &:hover { + text-decoration: underline; + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + box-shadow: 0 0 0 2px fn.color(--key-focus --border), fn.color(--key-focus --shadow); + } + } + } + + @include iro.bem-modifier('invisible') { + :link, + :visited { + text-decoration: none; + } + } + + @include iro.bem-modifier('colored') { + :link { + color: fn.color(--idle); + } + + :visited { + color: fn.color(--visited); + } + } + } +} -- cgit v1.2.3-70-g09d2