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.scss | 3 +-- src/scopes/_colored-links.scss | 38 ----------------------------- src/scopes/_invisible-links.scss | 32 ------------------------- src/scopes/_links.scss | 52 ++++++++++++++++++++++++++++++++++++++++ tpl/index.pug | 4 ++-- tpl/objects/bubble.pug | 2 +- tpl/objects/lightbox.pug | 2 +- tpl/views/colored-links.pug | 9 ------- tpl/views/links.pug | 25 +++++++++++++++++++ 9 files changed, 82 insertions(+), 85 deletions(-) delete mode 100644 src/scopes/_colored-links.scss delete mode 100644 src/scopes/_invisible-links.scss create mode 100644 src/scopes/_links.scss delete mode 100644 tpl/views/colored-links.pug create mode 100644 tpl/views/links.pug diff --git a/src/_scopes.scss b/src/_scopes.scss index abfb6a0..a3aeb6c 100644 --- a/src/_scopes.scss +++ b/src/_scopes.scss @@ -1,5 +1,4 @@ -@use 'scopes/colored-links'; -@use 'scopes/invisible-links'; +@use 'scopes/links'; @use 'scopes/code'; @use 'scopes/blockquotes'; @use 'scopes/lists'; 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); + } + } + } +} diff --git a/tpl/index.pug b/tpl/index.pug index 0bafbc9..d87fec8 100644 --- a/tpl/index.pug +++ b/tpl/index.pug @@ -53,7 +53,7 @@ mixin user-card(name, hue) include views/heading.pug include views/divider.pug -include views/colored-links.pug +include views/links.pug include views/code.pug include views/blockquote.pug include views/list.pug @@ -96,7 +96,7 @@ html .c-content.l-overflow +view-heading +view-divider - +view-colored-links + +view-links +view-code +view-blockquote +view-list diff --git a/tpl/objects/bubble.pug b/tpl/objects/bubble.pug index 8d878c8..5782ca5 100644 --- a/tpl/objects/bubble.pug +++ b/tpl/objects/bubble.pug @@ -32,7 +32,7 @@ mixin bubble(user) else if user header(class=headerClasses) strong= user - span.s-colored-links + span.s-links.s-links--colored - slots.body() if slots.time small.o-bubble__time diff --git a/tpl/objects/lightbox.pug b/tpl/objects/lightbox.pug index ac7d886..7298ed9 100644 --- a/tpl/objects/lightbox.pug +++ b/tpl/objects/lightbox.pug @@ -3,7 +3,7 @@ include icon.pug mixin lightbox(images) .o-lightbox header.o-lightbox__header - .s-colored-links + .s-links.s-links--colored block +action-button(round=true quiet=true icon='x' class='o-lightbox__close-btn') img.o-lightbox__img(src=images[0]) diff --git a/tpl/views/colored-links.pug b/tpl/views/colored-links.pug deleted file mode 100644 index 8951154..0000000 --- a/tpl/views/colored-links.pug +++ /dev/null @@ -1,9 +0,0 @@ -mixin view-colored-links - +view('colored-links', 'Colored links') - .c-box - .s-colored-links - = 'Lorem ipsum dolor ' - a(href='https://mk.vulpes.one/')= 'https://mk.vulpes.one/' - = ' sit amet, consetetur ' - a(href='https://v.reddit.com/')= 'https://v.reddit.com/' - = ' sadipscing elitr, sed diam nonumy eirmod tempor' diff --git a/tpl/views/links.pug b/tpl/views/links.pug new file mode 100644 index 0000000..91d6dde --- /dev/null +++ b/tpl/views/links.pug @@ -0,0 +1,25 @@ +mixin view-links + +view('links', 'Links') + .c-box + .s-links + = 'Lorem ipsum dolor ' + a(href='https://mk.vulpes.one/')= 'https://mk.vulpes.one/' + = ' sit amet, consetetur ' + a(href='https://v.reddit.com/')= 'https://v.reddit.com/' + = ' sadipscing elitr, sed diam nonumy eirmod tempor' + + .c-box + .s-links.s-links--invisible + = 'Lorem ipsum dolor ' + a(href='https://mk.vulpes.one/')= 'https://mk.vulpes.one/' + = ' sit amet, consetetur ' + a(href='https://v.reddit.com/')= 'https://v.reddit.com/' + = ' sadipscing elitr, sed diam nonumy eirmod tempor' + + .c-box + .s-links.s-links--colored + = 'Lorem ipsum dolor ' + a(href='https://mk.vulpes.one/')= 'https://mk.vulpes.one/' + = ' sit amet, consetetur ' + a(href='https://v.reddit.com/')= 'https://v.reddit.com/' + = ' sadipscing elitr, sed diam nonumy eirmod tempor' -- cgit v1.2.3-70-g09d2